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: Primary/Foreign key with legacy data
PostPosted: Mon Jan 10, 2005 11:33 am 
Newbie

Joined: Sun Feb 01, 2004 9:26 am
Posts: 3
Location: ITALY
Hibernate version: 3.0a

I have two legacy tables:

table A:
composite_pk
pk_A1
pk_A2
/composite_pk
prop_x
prop_y

table B:
composite_pk
pk_A1 <foreign key from table A>
pk_B2
/composite_pk
prop_w
prop_z

Table A and B are two Java objects: A contains a set of B objects retrieved through pk_A1.
Hibernate does not allow me to specify a <set> since it requires both columns from A's primary key.
Since the DB cannot be modified and no tables can be added, I tried quite a few mappings but I'm always stuck...
Any suggestion would be appreciated.


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.