-->
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.  [ 2 posts ] 
Author Message
 Post subject: Is it normal for Hibernate to update all children?
PostPosted: Thu Aug 11, 2005 7:32 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
This is 3.0.5.

If I have a parent that has a set of children, and the one-to-many is mapped with cascade=save-update, is it normal for Hibernate to issue a SQL update for all the children in the set when performing an update on the parent, even though none of them have actually changed? I used to think that was just the way <set> mappings worked, but Gavin's response in this thread has me wondering. As far as I know my equals() and hashCode() work correctly, but I do call retainAll() and addAll() on the collection(s).

What have been your experiences?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 2:29 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Put a breakpoint in the equalsSnapshot method of the PersistentSet class and you can see why hibernate think your objects are modified

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.