Hello,
I am trying to define a pointcut whose advice will run when method from a Spring Data JPA repository is invoked.
Here is my anonymous pointcut together with the inline advice (from PliEventManagerAspect):
Here the definition for my PliRepository:Code:after(Pli pli) returning: (execution(* org.springframework.data.repository.CrudRepository+.save(Pli)) && args(pli)){ System.out.println("Caught!!!!"); }
and PliRepositoryImpl:Code:public interface PliRepository extends GlobalRepository<Pli, Long>, PliRepositoryCustom {
and PliRepositoryCustom:Code:public class PliRepositoryImpl extends QueryDslRepositorySupport implements PliRepositoryCustom {
and lastly GlobalRepository:Code:public interface PliRepositoryCustom {
I have also set the javaagent command line arg. And I have the following aop.xml:Code:@NoRepositoryBean public interface GlobalRepository<T, ID extends Serializable> extends JpaRepository<T, ID> {
The above advice, which is supposed to run in LTW since it is advising a class in a jar, is not run at all... I am sure I must make some mistake in the pointcut definition. Can anyone please help?Code:<!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "http://www.eclipse.org/aspectj/dtd/aspectj.dtd"> <aspectj> <weaver options="-verbose"> <include within="org.springframework.data.repository..*"/> </weaver> <aspects> <aspect name="trc.suivi.aspects.PliEventManagerAspect" /> </aspects> </aspectj>
Regards,
Julien.
P.S. I deliberately posted on this specific forum instead of the AOP one because my question requires knowledge of Spring Data JPA and especially I can't pinpoint the specific class I need to specify in my poincut...


Reply With Quote
