我有以下hql查询:
from Admin a where a.genericTable is null or (a.genericTable.allowInsertion = true or a.genericTable.allowInsertion is null)
问题是结果集排除了过滤器中包含的所有条目:a.genericTable is null
有谁知道为什么?
谢谢!
答案 0 :(得分:1)
尝试左连接:
from Admin as a left join a.genericTable as g
where (g is null or (g.allowInsertion = true or g.allowInsertion is null))