-->
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: Hibernate mapping many-to-many
PostPosted: Thu Apr 05, 2012 7:45 am 
Newbie

Joined: Thu Apr 05, 2012 7:30 am
Posts: 4
Hi,

I'm trying to map a non standard relationship. I have to tables:

Parent_Table
---------------
id_table
cod_atribute

Child_Table
-------------
id_child_table1
id_child_table2
atributes

What I pretend is to join these two tables by cod_atribute = id_child_table1 association through hbm mapping file.

In my Parent_Table class entity I have a Set of Child_Table objects. If I define a one-to-many association the generated join statement is by id_table=id_child_table1. If I define many-to-many association I have an error because it is necessary to define id_child_table1 and id_child_table2 as foreign key.

Could you help me to successfully build this relationship?

Thanks.
JB


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.