This content has been marked as final.
Show 3 replies
-
1. Re: How to check if entity bean is changed
epbernard Oct 20, 2005 8:11 PM (in response to atodorov)There is no public API but through a hibernate interceptor you can achieve this
-
2. Re: How to check if entity bean is changed
atodorov Oct 21, 2005 3:55 AM (in response to atodorov)Do you mean something like this:
@Stateless public class BlaBlaBean implements BlaBla { .... public void editMyEntity(Doctor d) { // calling entityManager.merge(d) here } @AroundInvoke public Object mySessionBeanInterceptor(InvocationContext ctx) throws Exception { Doctor newDoctor = (Doctor) ctx.getParameters()[0]; Doctor persistedDoctor = entityManager.find(Doctor, newDoctor.getId()); // comparing the properties values of newDoctor and // persistedDoctor manually (or via reflection), // save the differences somewhere etc... return ctx.proceed(); } }
-
3. Re: How to check if entity bean is changed
epbernard Oct 21, 2005 5:53 AM (in response to atodorov)no a hibernate interceptor org.hibernate.Interceptor, check the Hibernate reference guide for more info.