-->
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: PreUpdateEvent does not provide old state of the entity
PostPosted: Mon Feb 11, 2013 8:43 am 
Newbie

Joined: Thu Jan 03, 2013 9:09 am
Posts: 3
Hello,
i am trying to obtain the minimum between the old value and the new one during an entity update

yet, using the PreUpdateEventListener with the arg : PreUpdateEvent
>>>
Object[] getOldState()
The old state of the entity at the time it was last loaded from the database; can be null in the case of detached entities.
>>>
the old state does come null...

could someone please advice about how to obtain the old state?

btw, i have tried to add a line of
session.buildLockRequest(LockOptions.NONE).lock() , hopping that this will reattach it before the update
yet, in this case, there seems to be problem because the event listener is not triggered anymore


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.