Hello,
I have a table with two columns. the columns are fk for another tables.
I annotated @ManytoOne to both tables, hibernate says the column is missing for only one column (USER_DEPT_ID). but both columns exist.
If I annotate just one table (PRIVILEGE_ID), no error is thrown.
Thanks for any help.
Code:
private Long id;
private UserDeptMap userDept;
private Privilege privilege;
@Id @GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="ID")
public Long getId() {
return id;
}
public void setId(Long id){
this.id = id;
}
@ManyToOne()
@JoinColumn(name="USER_DEPT_ID")
public UserDeptMap getUserDept() {
return userDept;
}
public void setUserDept(UserDeptMap userDept) {
this.userDept = userDept;
}
@ManyToOne()
@JoinColumn(name="PRIVILEGE_ID")
public Privilege getPrivilege() {
return privilege;
}
public void setPrivilege(Privilege privilege) {
this.privilege = privilege;
}