-->
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: recursive relation
PostPosted: Thu Oct 02, 2003 9:25 am 
Newbie

Joined: Thu Sep 25, 2003 7:21 pm
Posts: 17
Hi I am playing around with hibernate a bit, I'v read through the manual but I cant find out how to do the following :

I have a person who can have friendships with another person, this friendship also has properties , like when it was established
so my object model should probably become like this.

a person object with a name property and a friendships collection

a friendship object with an established date property and a person1 and person2 property


with diseperate objects in the "link object' you could have 2 many-to-one relationships but since both the friend1 and friend2 properies are friends you cant really do that.

Any cluess as how to do this or where to look in the manual


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2003 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a composite-element mapping. You would be better off using Hibernate 2.1 here, which supports full querying of composite elements.


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.