Hi,
I would like to ask you about the correct way of intercepting updates on mapped collections.
We have implemented an automatic auditing based on the following article: http://www.ideyatech.com/2008/07/audit-logging-via-hibernate-interceptor-12/
This is we are inheritting from org.hibernate.EmptyInterceptor.
We are overriding the method onCollectionUpdate().
We only want to audit the changes on collections, not the whole new state. The method onCollectionUpdate() only gives us the latest state of the collection.
When onFlushDirty() method of the interceptor is called for the parent entity, both previousState and currentState parameters also contain only the latest state of the collection.
What is the correct way to find the differences between the previous and the current states of the updated collections?
Many thanks for any tips or hints :)
Regards, Martin
|