我正在尝试连接多个表并将表列映射到用户对象列表。
下面是SQL查询,我试图使用Hibernate Criteria转换为ORM:
SELECT table1.domainname, table2.policyname,table3.filterpath,table4.userdirectoryname
FROM table1, table2,table3, table4
WHERE table3.domainoid = table1.domainoid
AND table3.policyoid = table2.policyoid
AND table3.userdirectoryoid = table4.userdirectoryoid
AND table1.domainname = 'admin'
从上面的查询中,我们将获得用户对象列表并尝试将结果映射到用户对象。下面是要形成的用户对象的POJO类。
public class DomainDetails {
String domainName, policyName, filterPath, userDirName;
public DomainDetails(String domainName, String policyName, String filterPath, String userDirName) {
super();
this.domainName = domainName;
this.policyName = policyName;
this.filterPath = filterPath;
this.userDirName = userDirName;
}
// getters and setters...
}
如何连接多个表以及将各列映射到用户对象?
感谢帮助......谢谢