-->
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: One to one mapping between 2 composite keys
PostPosted: Wed Jun 29, 2011 8:31 am 
Newbie

Joined: Thu Jun 23, 2011 9:34 am
Posts: 4
How to do one to one mapping between 2 composite keys using hibernate3 annotations?

Product
------------------
productID1 integer not null primary key
productID2 integer not null primary key
productDesc varchar(10) not null

PlasticProduct
------------------
productID1 integer not null primary key
productID2 integer not null primary key
plasticproductDesc varchar(10) not null
foreign key (productID1) references product(productID1))
foreign key (productID2) references product (productID2))

Here productID1 and productID2 are 5 digits each , both has to be concatenated to arrive the 10digit product key - which is supposed to be a composite key .

The understanding is that we have 1 composite key for each table . need to know how to do a one to one mapping between these 2 composite keys using hibernate annotations.

could any one explain me how to work it out .
Thanks


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.