• 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic