You can get informed by Hibernate if you write an Interceptor. For example see this:
Code:
public class HistoryInterceptor extends EmptyInterceptor {
(...)
public boolean onFlushDirty(final Object pEntity,
final Serializable pId,
final Object[] pCurrentState,
final Object[] pPreviousState,
final String[] pPropertyNames,
final Type[] pTypes) throws CallbackException {
// do something
}
There are other methods you might override, if needed. Have a look into the docs and Hibernate's source.
And: be aware that you are restricted in what you can (not) do in the interceptor!
Carlo