Hi..
I'm trying to do a critera search.
I have 4 subclasses that extends my "animal" class.
Lets say that the 4 subclasses are, "cat", "dog", "fish" and "rat"
The thing I'm trying to do is:
Criteria aniamlCrit = hibernateSession.createCriteria(Animal.class);
and then add something like:
animalCrit.add(Expression.eq("dog.name", "Fido");
animalCrit.add(Expression.eq("cat.sex", "male");
I want to get Animal objects from this... with all dog's having the name Fido and all Cat that are males.
can't get this to work.. (is it possible at all?)
//Martin
|