Chsquill wrote:
So to my question.
How do I specify the same for the B's, a restriction on the B1 class hierarchy?
The
Criteria.createCriteria(String associationPath)
do not take any entity type arguments. What I would like is
Criteria.createCriteria(String associationPath, Class entityType)
In your example you should be able to create a Criteria for A then:
criteria.createCriteria(associationPath).add(Criterion) where Criterion is an Example of you B and your association path would be the field name of B in A.
Thanks
Yes, that sounds correct.
So my question is then really, how do I create a Criterion that matches
"All instances of class B2 (and its sub classes including B2), but no instances of B which is not sub class of B2 (for example B1)"
?
Øyvind