-->
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: Question on documentation example of parent-child (21.2)
PostPosted: Wed Aug 09, 2006 5:46 am 
Newbie

Joined: Wed Aug 09, 2006 5:26 am
Posts: 2
I have a question about the example presented in the Hibernate docs at http://www.hibernate.org/hib_docs/v3/reference/en/html/example-parentchild.html (section 21.2)

In this example of a Parent-Child relationship, the Child entity is required to contain a reference to the Parent. My question is why this is needed: the parent contains in the <set> mapping the column used as the key in the child table, and the Parent object created contains references to the child objects. It seems to me Hibernate has all the necessary information to persist the child without requiring it have a reference to its Parent.

Is it possible to create a mapping that has no reference from the child to the parent, where the ID field for the child is contained only in the Parent's collection? (Would a map rather than a set allow this?)


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.