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
  • 18,967
  • 25
  • 73
  • 118
  • 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,149
  • 7
  • 65
  • 100