-->
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: Hashset uses
PostPosted: Sun Oct 05, 2008 9:13 am 
Newbie

Joined: Sun Oct 05, 2008 9:04 am
Posts: 1
Hi,
This is Ramesh. I am implementing Hibernate in my project.
I have one dobt
when forgien key is mapped between one to many and many to one mappings as a biderectional mappings.

If I saved the bean it has HashSet property. then is child beans will save or not.

can any one please tell me


Thanks & Regards
Ramesh K


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 05, 2008 2:07 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
The children being saved saved does not depend on whether the operation you used to link the parent to the session (save, persist, update) is comprised in the "cascade" parameter in your set's mapping declaration.
Or you can use cascade="all", and that will cascade all operations to the children.

If the implementation of Set you used in the parent class is Hashset, then it is recommended that you implement equals() and hashCode in the children classes, using business fields other than the ID.

_________________
Gonzalo Díaz


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.