Hibernate INNER join不起作用.SQL Query Works ...奇怪的行为

Kat*_*hir 7 hibernate

查询在HQL中返回零记录(查询1 =查询2 +查询3):

两个OR条件.它不返回结果,而是返回零记录

from Employee as emp where empState = 'ACTIVE' and exists (from EmployeeOrg as 
EmployeeOrg where 52 = 52 and ((EmployeeOrg.empDetailTable is null and 
EmployeeOrg.empId like '10002') or (EmployeeOrg.empDetailTable is not null and 
EmployeeOrg.empDetailTable.empId like '10002')));
Run Code Online (Sandbox Code Playgroud)

Query2以HQL方式返回记录:

from Employee as emp where empState = 'ACTIVE' and exists (from EmployeeOrg 
as EmployeeOrg where 52 = 52 and ((EmployeeOrg.empDetailTable is null and 
EmployeeOrg.empId like '10002')));
Run Code Online (Sandbox Code Playgroud)

Query3在HQL中返回零记录

from Employee as emp where empState = 'ACTIVE' and exists (from EmployeeOrg 
as EmployeeOrg where 52 = 52 and (EmployeeOrg.empDetailTable is not null and 
EmployeeOrg.empDetailTable.empId like '10002'));
Run Code Online (Sandbox Code Playgroud)

当我们结合条件时 - 查询1结果为零记录

我怀疑这是一个hibernate错误或默认行为或查询需要纠正.

在连接多个表时,OR和And条件基本上不能正常工作.

谢谢.