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.
加载中,请稍侯......
精彩评论