Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Pointcut not being executed...

EntityManager.persist() accepts an Obect argument. This static typing is all that AspectJ will look at. You will have to intercept *all* calls to the method, regardless of the argument type, then inspect thisJoinPoint.getArgs()[0] to see if it's the type you're looking for, and acting if it is the case.

_________________________
Sent over RFC-1149 compliant transport - please excuse occasionnal packet loss

Le 2 août 2012 à 17:44, Julien Martin <balteo@xxxxxxxxx> a écrit :

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@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top