Problem on Hql query
I have the following hql query:
from Admin a where a.genericTable is null or (a.genericTable.allowInsertion = true or a.genericTable.allowInsertion is null)
The problem is that the result set is e开发者_如何学JAVAxcluding all entries that are comprised on filter: a.genericTable is null
Does anyone knows why?
Thanks!
Try a left join:
from Admin as a left join a.genericTable as g
where (g is null or (g.allowInsertion = true or g.allowInsertion is null))
精彩评论