【发布时间】:2018-02-06 11:18:45
【问题描述】:
我在 JPA 中遇到了这个查询的问题
员工表
id,....,location_id (id 1,2,3,4 assigned to location id 1)
EmployeeMaster 表
id,.....,date, employee_id(employee_id 1 and 2 having records in this table)
JPA 查询
select me,ms from EmployeeMaster ms right join ms.employee me where ms.date between ?2 and ?3 and me.location.id = ?4
输出
employeeMaster,employee1
employeeMaster,employee2
因为日期之间只有两个员工在 EmployeeMaster 表中有记录
我希望输出是这样的
employeeMaster,employee1
employeeMaster,employee2
null,employee3
null,employee4
请帮我解决这个问题
谢谢。
【问题讨论】: