-->
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.  [ 2 posts ] 
Author Message
 Post subject: class with composite-id and join not working
PostPosted: Tue Aug 07, 2007 3:08 am 
Newbie

Joined: Tue Jul 31, 2007 8:37 am
Posts: 12
Hello!

I'm new to Hibernate and I've been searching the problem for some time now, but i cant find a solution.

I have a class using a composite-id Key element.
But i also want to join with another table with only one part of the composite key. Is this possible with Hibernate?

I get the Error:
Foreign key (:RP [RP_ID])) must have same number of columns as the referenced primary key (ZR [RP_ID,ZB_ID])

thanks for helping!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 4:14 am 
Newbie

Joined: Tue Jul 31, 2007 8:37 am
Posts: 12
Is this mapping not possible? Or anyone who knows how to work around with another mapping association?

Here are my tables from a legacy DB:

Code:

Table A
- zID (pk)
- a lot of properties

Table B
- zID (pk,fk)
- rpID (pk,fk)
- a lot of properties

Table C
- rpID (pk)
- a lot of properties



As you can see, there is a foreign key from B -> A and from B -> C. This is also the compositeKey from B.

I allready know how to map it with mapping files for each table, but i'm looking for a possibility to map only table B with the <join-table> attribute to the other two tables.

Anyone know, if this is possible?

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.