开发者

Create Hibernate criterion to select on property of property

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" ?


criteriaForA.createAlias("b", "b").add(Restrictions.eq("b.c", "valueForC");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜