开发者

How to do inner join using only ID in Hibernate Criteria API?

Assume I have this mapping:

class User {
    String name;开发者_高级运维
    ...
}
class Department {
    String id;
    User owner;
    ...
}
class Employee {
    String departmentId; //legacy code, I cannot change this
}

I want to query all Employees sorted by their department owner's name (sorted by Employee.departmentId.owner.name) using Hibernate Criteria API.


Criteria api or hql works with relational mapping so you can not use something like departmentId.owner.name. But there are some solutions here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜