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
|
|