-->
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: Foreign key with more than one column
PostPosted: Fri Apr 08, 2005 3:36 am 
Beginner
Beginner

Joined: Wed Aug 04, 2004 4:33 am
Posts: 45
Location: Switzerland
Hibernate version:2.1.8

How can I map a foregin key constraint with multiple columns?

I have a table report_field with a primary key of two columns (report_def_id and column_id) which itself are foreign keys. Than I have a table function with a primary key of two columns (function, report_def_id and column_id). So the primary_key of one table is contained in the primary key in the other table and is a foreign key.

This is how the table structure looks like:

function
---------
PK,FK1 report_def_id
PK,FK1 column_id
PK function
.
.
.

report_field
-------------
PK,FK2 report_def_id
PK,FK3 column_id
.
.
.

Thank you very much for your help!


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.