Hello,
I am playing with spring 2 aop features, I try to intercept call to the 'persist' method of entityManager in order to do something with the instance candidate for persistance. Since I do not know which implementation of javax.persistence.EntityManager I use in my code I cannot declare properly the pointcut expression. When I display this.entityManager.getClass().getName(), I just get the proxy.
I use hibernate so I tried
pointcut="execution(* org.hibernate.ejb.AbstractEntityManagerImpl.persis t(..)) and args(entity)" arg-names="entity"
but with no success. The objects are correctly persisted but the aspect is not called. The same aspect works correctly when the pointcut expression concerns one of my classes.
In the same time I manage to work with several other aspects (with / without parameters, before/after/...) but the poincut expression always targets a class of my application.
Thanks for your opinion, and sorry if my question seems a bit naive (I am pretty new to aop in the spring 2.0 fashion). By the way, this question may be more related to hibernate than spring.
Gengis


Reply With Quote

