-->
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: Unidirectional many to many using same class and optional
PostPosted: Wed Sep 14, 2005 4:33 am 
Newbie

Joined: Tue Sep 13, 2005 3:03 pm
Posts: 1
Hope this doesn't get RTFM. I have looked!

I have a class Client. This class may or may not have children, which will be of the Client class and may or may not also be Clients in their own right. If both parents are clients, then the child/children may be linked to both parents.

What I, ideally, would like to end up with is a client table, and a childClient link table with a clientId and childId, where the childId is the child's id in the client table. The primary key would be the clientId and childId, therefore it would allow for more than one parent to be linked to the child. Is this possible?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 4:51 am 
Pro
Pro

Joined: Fri Sep 02, 2005 4:21 am
Posts: 206
Location: Vienna
If I understand your requirements correctly, this is a classical case of a many-to-many relationship, which allows to model what you describe.

Take a look at the documentation ;-) - or at Hibernate in action.

Erik


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.