-->
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: Mapping Ternary Association in Hibernate
PostPosted: Fri Jul 01, 2005 5:58 pm 
Newbie

Joined: Fri Jul 01, 2005 5:41 pm
Posts: 2
Assuming I have the following:

A* <-----> *B

and C has also has a many-to-many relationship to the association of A and B.

In my situation, C is dependent on A and B. From a relational perspective, I have the following two associative tables:

Table AB with a_id, b_id and table ABC with a_id, b_id and c_id. In table ABC, a_id and b_id are foreign keys that reference primary key a_id and b_id in table AB. Also, the primary key for table ABC is composite: a_id, b_id and c_id.

How do I map that in hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 01, 2005 11:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
It even has its own section in the doco :)

http://www.hibernate.org/hib_docs/v3/reference/en/html/collections.html#collections-ternary


Top
 Profile  
 
 Post subject: The ternary section is not clear to me
PostPosted: Sat Jul 02, 2005 6:03 am 
Newbie

Joined: Fri Jul 01, 2005 5:41 pm
Posts: 2
I was aware of the ternary section in the Hibernate doc but it was not too clear to me. Can you shed some light on it? Please use my scenario above to demonstrate how the mapping could be done.

Thanks


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.