我想将以下子查询转换为使用休眠子查询:
getCurrentSession().createQuery("from Employee where id in (select adminId from Department where adminId is not null)")
.list();
员工:
@ManyToOne @JoinColumn(name = "fk_department_id", nullable = true) private Department department;
部门:
@OneToMany(fetch = FetchType.EAGER) @JoinColumn(name = "fk_department_id") private Set<Employee> employees = new HashSet<Employee>(0);
谁能给我一个这个转换的例子,因为我读了一些例子,但我仍然不知道如何做到这一点。