-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to get old value?
PostPosted: Mon Jul 25, 2005 5:22 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
If I've made modifications to an object attached to a session is there any way to easily get the "old" version of the object?

A possible way I've thought of for doing this include evicting the object before making the modifications and keeping a reference to it for comparison later but I was wondering if there is any better/easier mechanism.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 5:31 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
I think you need to define a history table in your database design.

This might help as well:
http://www.hibernate.org/195.html

Best regards
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 6:16 am 
Regular
Regular

Joined: Thu Nov 20, 2003 10:04 pm
Posts: 64
Location: Melbourne, Australia
In exactly what I'm after in this case.

I don't really want to keep a record of historical values. Just to compare what's changed between the in-memory copy of the object and the version that's currently persisted to the database.


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

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.