-->
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.  [ 3 posts ] 
Author Message
 Post subject: <one-to-many> semantics and implementation
PostPosted: Wed Jan 28, 2004 2:10 pm 
Beginner
Beginner

Joined: Thu Oct 23, 2003 11:22 am
Posts: 20
Okay, I am trying to create directly associated parent/children. In reading the documentation regarding this, I am left with some implementation questions.

1. does the implementation class of the child need a get/set pair for the parent id, or is that an automatic (under the hood) generation by hibernate?

2. if the child needs a get/set pair... is the correct semantic setParent(Parent p) or setParentId(long id)?

3. in the examples in section 6.9-11, it shows that the only difference in the bidirectional one-to-many association with/without inverse=true is that the child parent id is set to not null??


Top
 Profile  
 
 Post subject: Re: <one-to-many> semantics and implementation
PostPosted: Wed Jan 28, 2004 3:48 pm 
Newbie

Joined: Tue Jan 27, 2004 3:26 pm
Posts: 18
lwsiv wrote:
Okay, I am trying to create directly associated parent/children. In reading the documentation regarding this, I am left with some implementation questions.

1. does the implementation class of the child need a get/set pair for the parent id, or is that an automatic (under the hood) generation by hibernate?


It's done automatic under the hood. You have to define only Parent and Child members.

lwsiv wrote:
2. if the child needs a get/set pair... is the correct semantic setParent(Parent p) or setParentId(long id)?


setParent(Parent p).

Artur


Top
 Profile  
 
 Post subject: Re: <one-to-many> semantics and implementation
PostPosted: Thu Jan 29, 2004 7:19 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
karaznie wrote:
lwsiv wrote:
Okay, I am trying to create directly associated parent/children. In reading the documentation regarding this, I am left with some implementation questions.

1. does the implementation class of the child need a get/set pair for the parent id, or is that an automatic (under the hood) generation by hibernate?


It's done automatic under the hood. You have to define only Parent and Child members.

It's not generated under the hood, but Hibernate knows the id because it manages the association.

3. http://www.hibernate.org/Documentation/InsideExplanationOfInverseTrue

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.