Hibernate Issue : Foreign key must have same number of columns as referenced primary key
Goal : I want to have importJobId in ImportJob as foreign key for id of allocation table, such that when we have importJobId then and then only we can have id in allocation as without Job there cannot be any allocations. ImportJob table has composite primary key as [ORGID,IMPORTJOBTYPE] and am trying to get create foreign key relationship in hibernate using <id name="id" column="ID"> <generator class="native"/> </id> <many-to-one name="importjobid" class="com.delta.pdo.admin.ImportJob" cascade="save-update"/> in Allocation.hbm.xml which is not working out and am getting error message as: