You may look into using the Interceptor interface.
You attach it to your session:
Code:
getSessionFactory().openSession(myInterceptor)
and then whenever Hibernate flushes the session, onFlushDirty(...) gets called, with a list of 'original' property values. The list of original values will be empty (null) if you happen to flush a (previously) detached object, or a new object instance.
Granted, it is not exactly what you are asking for, but maybe it could help.
Another option is [possibly a way to implement session.isDirty(Object obj)]
Code:
PersistenceContext ctx = session.getPersistenceContext();
using methods such as:
Code:
EntityEntry entry = ctx.getEntity(EntityKey key)
Object props = entry.getLoadedState(String propertyName)
but I admit I have not done it - and there is probably more to consider.
Don't forget to rate this reply (if it did help).
Martin