2

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
  • Do you have some example rows which you think should be returned? Commented May 20, 2010 at 16:13

1 Answer 1

1

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))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.