hql:内部联接与Map <key,value>以及select?</key,value>中的访问键和值

时间:2010-12-26 08:38:13

标签: mysql hibernate map hql inner-join

这是问题

    public class Company
    {
            private Map<Location, Manager> locationManagerMap;
    } 

一个地点只有一个经理。经理可以与许多地点相关联。

    public class Assignment
    {
            private Location location;
            private Manager
    } 

现在假设我想通过使用子查询的hql查询来检索公司的所有分配列表,如下所示。

    String query = "select from Assignment as assignment where (assignment.location, assignment.manager) in (select locationManager._____________ from Company as company inner join  company.locationManagerMap as locationManager where company.id=?) "

在上面的查询子查询中,公司内部与locationManagerMap连接。我想访问此映射的键和值以执行多列条件检查。请在查询中建议空白语法应该是什么?

1 个答案:

答案 0 :(得分:1)

它应该是这样的:

... index(locationManager), locationManager ...