Foreign key must have same number of columns as the reference
posted 3 years ago
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?