我有必须将部分复合键映射为外键的情况,例如,hibernate是否可以将部分复合键映射为外键?
class Employee {
@embededId
EmployeeId id;
}
class Mobile {
@Id
int mobId;
@ManyToOne
@JoinColumn(name="empId" referencecolumnname="empId")
Employee emp;
}
class EmployeeId {
private int empId;
private int deptId;
}