-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: AutoFlushListener and History
PostPosted: Mon Jul 24, 2006 11:07 am 
Newbie

Joined: Mon Jul 24, 2006 5:37 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.