-->
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: Parent/Child/Grandchild Relationship
PostPosted: Wed Feb 09, 2011 4:30 pm 
Beginner
Beginner

Joined: Fri Nov 13, 2009 4:05 pm
Posts: 30
Could someone take a brief moment and outline how to properly annotation three classes where you have a parent, child and grandchild relationship. The parent contains a list of children while the children contain a list of grandchildren objects. The child and grandchild objects use a composite key where the child is a combination of a sequence and the parent id while the grandchild is a combination of a sequence, child and parent ids.

What I need to be able to do is once a grandchild record is added to the child's list and the child is added to the parent; I can safely save the parent and the records will all persist to the database in one single operation.


Top
 Profile  
 
 Post subject: Re: Parent/Child/Grandchild Relationship
PostPosted: Wed Feb 09, 2011 7:40 pm 
Newbie

Joined: Wed Jan 26, 2011 12:32 pm
Posts: 12
Try cascade with all option


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.