-->
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: Hibernate 2 FKs to the same table
PostPosted: Mon Nov 05, 2007 12:34 pm 
Newbie

Joined: Mon Nov 05, 2007 12:10 pm
Posts: 5
Hello,

i have following problem:

I have one table MODULE.
And i have one table CONSUMER.

Now i want to connect MODULE with CONSUMER,
because evry MODUL has one CONSUMER.

But the difficult part is, that i need another connection
from MODULE to CONSUMER.

Both are 1 to 1, but they are different.

Consumer has only one PK wich the Module has to connect with.
Module have two Columns with IDs for Consumer.

And all this with XML File, not with annotations...

How can i solve that problem?

I tryed to search for that, but i cant discribe my problem.

Thank you for your answers :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 05, 2007 1:32 pm 
Beginner
Beginner

Joined: Tue Oct 30, 2007 7:57 am
Posts: 47
I am not sure about what you are trying to do. Please, write the names of the columns in each table which refer to table relations, and what kind of relation they support. That would help to solve your problem.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 05, 2007 1:37 pm 
Newbie

Joined: Mon Nov 05, 2007 12:10 pm
Posts: 5
I am not sure about what you are trying to do. Please, write the names of the columns in each table which refer to table relations, and what kind of relation they support. That would help to solve your problem.

Table MODULE
columns: module_id int <pk>
main_consumer_id int <fk1>
alternativ_consumer_id int <fk2>
....

Table CONSUMER
columns: consumer_id int <pk>
...


I want to connect main_consumer_id with consumer_id
and a second connection from alternativ_consumer_id to consumer_id.

Afther this, i have two 1..1 relations.


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.