Hi all,
I hava a problem with listeners. I want to trigger one before update(only) to copy current 'state' of persistent object and store it in another table in db. Problem is, when I run:
session.update(entity);
...
tx.commit();
only AutoFlushListener triggers though I've set listeners in hibernate.cfg.xml:
<listener type="save-update" class="....SaveUpdateLstnr" />
So I was looking for a way to obtain my entity from AutoFlushEvent, but I haven't found one.
SaveOrUpdateEvent class has method getEntity() which makes it easy to write a version of object in db, is there any way to do it with AutoFlush or to force triggering SaveOrUpdateListener?
Sincerely,
wtn
|