the call (and execute) pointcuts take a declared method signature. call(* javax.persistence.EntityManager.persist(trc.suivi.domain.Pli))
doesn't look right to me. I'm sure the EntityManager.persist() method is not declared to take a 'trc.suivi.domain.Pli' (although that is what might be getting passed at runtime). You want something more like: call(* javax.persistence.EntityManager.persist(*) && args(trc.suivi.domain.Pli) args() is a runtime check on the argument to confirm what type it is. (I only used '*' in the persist() signature as I don't know what persist() really takes) and if you want to bind it in the pointcut declaration, you want something more like this: pointcut catchIt(Pli pli): call(* javax.persistence.EntityManager.persist(*) && args(pli); cheers, Andy On 2 August 2012 08:44, Julien Martin <bal...@gmail.com> wrote: > Hello, > > I mean to intercept only calls of EntityManager.persist when the argument is > of type trc.suivi.domain.Pli > > I have tried the following code: > > pointcut catchIt(Pli pli) : (call(* > javax.persistence.EntityManager.persist(trc.suivi.domain.Pli))); > after(Pli pli) returning: catchIt(pli) { > log.debug("catchIt"); > Evenement ev = new Evenement(); > ev.setDateCreation(new Date()); > ev.setIdObjetProprietaire(pli.getId()); > evenementRepository.save(ev); > } > > and nothing happens. > > Can anyone please help? > > Regards, > > J. > > _______________________________________________ > aspectj-users mailing list > aspectj-users@eclipse.org > https://dev.eclipse.org/mailman/listinfo/aspectj-users > _______________________________________________ aspectj-users mailing list aspectj-users@eclipse.org https://dev.eclipse.org/mailman/listinfo/aspectj-users