I have an entity which might have a parent entity. I want to run this query:
select entity where entity.parent.id = 9
some of the entity does not have parents (entity.parent = null) and N HIBERNATE Fails to run this query (QueryException - Could not resolve property)
How can I use HQL to get all the entities that has parents entities with id 9, avoiding the ones that the parent is null ?
(adding entity.parent is not null before the entity.parent.id = 9 results in the same exception)
There is an option to use a nested select statements but I don't think this is the most efficient solution.