【发布时间】:2019-10-13 00:20:54
【问题描述】:
我假设设置如下:https://howtodoinjava.com/hibernate/hibernate-one-to-many-mapping-using-annotations/
员工:
@JoinColumn(name="EMPLOYEE_ID")
private Set<AccountEntity> accounts;
帐号:
@ManyToOne
private EmployeeEntity employee;
使用 JPA/Hibernate,如何使用适用于 Account 的 WHERE 条件获取结果。换句话说,查询类似Select all employees with accounts with sales > 0 或类似的内容。
【问题讨论】:
-
帐户表中的销售列在哪里?
-
@Abhijeet
sales列将是帐户表中的数字值(INT,...)
标签: java spring hibernate jpa criteria