-->
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: can not get the previous value after invoking save()
PostPosted: Thu May 12, 2011 11:06 am 
Newbie

Joined: Sun Dec 16, 2007 10:58 pm
Posts: 1
hey guys,

I have this scenario:

Object A {
Set<Object B> bSet;
}
A and B is bidirectional one-to-many
Object B {
Object c;
setC(Object c) {}
}
B and C is unidirectional many-to-one
Object C {
String name;
}

I changed the property [name] value from 'tom' to 'jack' of object c and called the setter of setC(){} of object B; then, called A.getBSet().add(c), and save object A.
Here is problem, after invoking the save method for object A, I try to use AbstractPersistentCollection.getStoredSnapshot() to get the snapshot of bSet, and get object c to see what is the previous value and what is the new value, but I always get the saved value, I just can't get the previous value.
Any idea about this?

Thanks a lot.


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.