Hi all,
I'm implementing an Audit interceptor and everything works but one thing: I always have to historize all the properties
I won't annoy you with the onFlushDirty previousState=null problem beacause I understood that the problem is in having only the updated object in session.
Now I read the interesting
http://www.hibernate.org/161.html but integrating it in my application would be so laborious to justify this other intersting approach
http://blog.hibernate.org/cgi-bin/blosx ... ggers.html that's also laborious
Now, also if it's not advised as the best pratice I would like to attach my before-update object to the session in order to have the previous state populated. I tried lots of solutions like
old = session.get(Foo.class, new.getId());
session.evict(old);
session.update(new);
but the previous state in the interceptor was still null (and I need it to persist only the changes)
I read lots of messages over the net but none was clear.
If I will solve this I will submit all my Audit interceptor to give others having my same problem (lots of persons) a working example that should work in most cases (as the AOP philosophy wants).
thx in advance for any clue
LUCA
I'm using Hibernate 3.1