Suppose I have classes like:
class A { B getB(); C getC(); } class B { String getFoo(); } class C { int getBar(); }
and I want to filter
You only need to create one criteria object like so.
Criteria criteria = session.createCriteria(A.class); criteria.add(Restriction.disjunction() .add(Restriction.eq("b.foo", "something")) .add(Restriction.eq("c.bar", 0)));