-->
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.  [ 1 post ] 
Author Message
 Post subject: many to many relationship
PostPosted: Sun Apr 04, 2010 10:09 pm 
Newbie

Joined: Tue Oct 16, 2007 10:56 pm
Posts: 9
I have 5 table TA1, TA2, TB1, TB2 and TS. Table TA1 having many to many relationship with table TB1 and table TA2 having many to many relationship with table TB2. the 2 many to many relationship between the 4 tables are joined using one common table TS. Schema of the 5 tables are as below:

TA1: ta1ID, etc...
TA2: ta2ID, etc...
TB1: tb1ID, etc...
TB2: tb2ID, etc...

TS: taId, tbId, tableType //tableType is a string. possible value is either table1 or table2.

Can you show how to represent this relationship in Hibernate? 2 relationships joined using one common table which has a field that help to indicate whether a row belong to the first or second relationship.


Thanks,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.