Hallo!
I have a Parent class with some Children in a Set. I ask the user to give me some children's id and I use them to get the Parent that contains at least this children.
If the user give me only one child (with id=1 for example) it's simple:
Code:
Criteria criteria = session.createCriteria(Parent.class);
Criteria childrenCriteria = criteria.createCriteria("subChildren");
childrenCriteria.add( Expression.eq("id", new Integer(1)) );
List results = criteria.list();
If the user tell me "give me the Parent that have at least the children with id=1 and id=2" i tried with the conjunction of two Expression.eq but it doesn't work!! I get no result!
There is a way to make this with Criteria (no Query)?
Thanx for any help and sorry for my english!!