1

I have two classes:

class A {
    private B b;
    /* ... */
}

class B {
    private String c;
    /* ... */
}

Can I create a Hibernate criteria to select all A where b.c = "foo" ?

Paul McKenzie
  • 19,646
  • 25
  • 76
  • 120
  • Have a look at http://stackoverflow.com/questions/2252468/hibernate-criteria-and-multiple-join – mindas Jun 30 '11 at 10:50

1 Answers1

1
criteriaForA.createAlias("b", "b").add(Restrictions.eq("b.c", "valueForC");
Stijn Geukens
  • 15,454
  • 8
  • 66
  • 101