Hi,
Iam having a table which is having three fields.
Table name: REGION_AUCTION
composite primary key: auction_id + region_id + auction_loc
one more column named: auc_rep_id --> mapped to user_id in USERS table.
This table is refering to another table(Users).
Table name : USERS
primary key: user_id
And there is One-to-Many relationship between REGION_AUCTION and USERS.
Here iam getting a MappingException saying that "Foriegn Key(user_id) must be defined for the referenced primary key(auction_id,region_id,auction_loc)"
My question is how can i write a <set> tag in REGION_AUCTION.hbm.xml to refer USERS table and a corresponding <many-to-one> tag in USERS.hbm.xml
Please help me out to resolve this problem. Thanks in advance...
_________________ Regards
Pcnarra
|