You can use something like this.
Criteria crit = session.createCriteria(Parent.class).createAlias("children", "child").add(Restrictions.like("child.name", "first")).add(Restrictions.like("child.name", "second"));
select this_.id as id0_1_, this_.name as name0_1_, child1_.id as id1_0_, child1_.name as name1_0_, child1_.PARENT_ID as PARENT3_1_0_ from MyParent this_, MyChild child1_ where this_.id=child1_.PARENT_ID and child1_.name like ? and child1_.name like ?
parent has many children while each child has a parent
|