I have 4 entities in a Hierarchy like this:
Code:
Entity1
|
------------------------
| | |
Entity2 Entity3 Entity4
And I am interested in retrieving All the instances of Entity2 and Entity3, but not Entity4 instances) with a criteria in a
single Query.
This is easy to do with HQL as follows:
Code:
FROM Entity_1 obj
WHERE obj IN (FROM Entity2) OR
obj IN (FROM Entity3)
But after a deep study of Hibernate Criteria API,
I cannot find a way to express this HQL query as a Criteria.
Is this a limitation of Criteria API? Or is it just that i didn't find how to do it?
Thank you in advance!