-->
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.  [ 6 posts ] 
Author Message
 Post subject: MANY TO MANY ASSOCIATION on the same table
PostPosted: Wed Oct 19, 2005 3:56 pm 
Newbie

Joined: Wed Oct 19, 2005 3:45 pm
Posts: 14
I want to make a relation (many to many) between two objects of the same class.
I already know that i need another table which contains two foreings key pointing to the id on the table.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
yes...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:11 pm 
Newbie

Joined: Wed Oct 19, 2005 3:45 pm
Posts: 14
Ok. the question is how i map this situation on the hbm.
I´ve got a set of element of the same class inside my class, but at the time to write the hbm i don´t know...

Please help..-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
http://www.hibernate.org/hib_docs/v3/reference/en/html/associations.html#assoc-unidirectional-join-m2m


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:32 pm 
Newbie

Joined: Wed Oct 19, 2005 3:45 pm
Posts: 14
but the example shows two clasess, my problem is that i´ve got just one class..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 4:49 pm 
Expert
Expert

Joined: Thu Jan 08, 2004 6:17 pm
Posts: 278
Try it anyway :-) Hibernate doesn't so much care what's on each end of a mapping.

Cheers,
Rob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.