@oneToMany(mappedBy="manager") private List<Course> managedCourses = new ArrayList<Course>();@oneToMany(mappedBy="lecturer")private List<Course> lectuedCourses = new ArrayList<Course>();
…
@Entity@Table(name = "courses")@Componentpublic class Course implements Serializable@ManyToOne@JoinColumn(name="lecturer_id", insertable=false, updatable=false)private Employee lecturer;@ManyToOne@JoinColumn(name="manager_id", insertable=false, updatable=false)private Employee manager;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)