我在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
请帮我解决这个问题
感谢。
答案 0 :(得分:0)
而不是检索employeeMaster检索员工,您将获得结果。