tags:

views:

37

answers:

1

Hi there!

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 excluding all entries that are comprised on filter: a.genericTable is null

Does anyone knows why?

Thanks!

+1  A: 

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))
Neal Swearer