Joined: Mon May 10, 2004 11:25 am Posts: 1 Location: Zurich, Switzerland
|
I have implemented an audit log using Interceptor.onFlushDirty, using the increment key generation strategy.
When I changed the key generation strategy from increment to identity column, onFlushDirty was not called any more and onSave had an id which was null.
The only method which knows the correct id was postFlush(), but postFlush() is called more than once with the same object and postFlush sees the same object multiple times.
The Lifecycle callbacks are also called before the update.
Is it possible to implement an audit log with identity columns and hibernate, or is it better to use database triggers for that?
Hibernate Version:2.1
|
|