nhibernate - Avoiding NULL object in HQL Query where clause -


I have an organization that can be a basic unit. I want to run this query:

Select the unit where entity.parent.id = 9

there are no parent in the institution (entity.parent = null ) And N. Hibernate Fail to run this query (QueryException - Property can not be resolved)

I used HQL to retrieve all the 9 IDs that prevent people with parental null How can i use

(entity.parent.id = 9 results before the same exception, the entity entry is not empty)

There is an option to use nested selection statements but I It does not seem to be the most efficient solution.

You are missing from from HQL query trying to write it this way Do:

From the unit where the unit peer is not empty and entity.parent.id = 9

is not definite, but perhaps unit peer Is not empty part is not necessary I think NHibernate will handle this scenario.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -