It works. Thanks a lot to both of you.
I've just ordered the "AspectJ in action" book that will help get started
with AspectJ because I am quite a beginner in AspectJ as you can see. [?]
Regards,
J.

2012/8/2 Romain MULLER <romain.mul...@esial.net>

> 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 <bal...@gmail.com> 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@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
>
>

<<328.png>>

_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to