• Post Reply Bookmark Topic Watch Topic
  • New Topic

Foreign key must have same number of columns as the reference

 
Aarthi Narasimhan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to join two A and B tables using USER_ID column. Here configuration in.hb.xml file is used instead of annotations. When I tried to do many-one mapping between A and B I am getting this exception Foreign key (A [USER_ID])) must have same number of columns as the referenced primary key (B [USER_CODE,USER_ID]). Table B has two primary keys USER_CODE and USER_ID. how can I do this?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!