JPA OneToOne and OneToMany on the same entity [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: JPA OneToOne and ManyToMany between two entities I've searched for a solution to no avail. My question is I have two entities "Employee" and "Department" Many Employees belongs to One Department And One Department is headed by One Employee. Am getting errors anytime introduce both the @OneToOne and @OneToMany. This is the code public class Department { @Required public String deptName; @OneToMany(mappedBy="dept"