-->
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: hbm.xml many-to-many with composite key question
PostPosted: Thu Jan 31, 2013 3:38 pm 
Newbie

Joined: Thu Jan 31, 2013 3:26 pm
Posts: 1
Hibernate n00b here. I've been looking for an answer to this, but my google-fu has turned up nothing.

So, I've got four tables: A, B, C, and ABJoin.

Tables A and B have a many-to-many relationship through ABJoin making ABJoin's structure look like the following:
AID int
BID int
primary key(AID, BID)

HOWEVER, references between A and B can have duplicates, which is enabled by references to table C which changes the structure of
ABJoin to:
AID int
BID int
CID int
primary key(AID, BID, CID)

Now, values in table A and B don't care about the existence of table C. The only table that cares about C is ABJoin, and only for the where clauses of the queries.

How in God's name do I define this relationship in my hbm.xml file for my A and B objects?


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.