hql:与 Map的内连接以及 select 中的访问键和值?
这是一个问题:
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=?) "
在上面查询的子查询中,company 与 locationManagerMap 内连接。我想访问此映射的键和值以执行多列条件检查。请建议查询中空格中的语法应该是什么?
Here is problem
public class Company
{
private Map<Location, Manager> locationManagerMap;
}
A location has only one manager. A manager can be associated to many locations.
public class Assignment
{
private Location location;
private Manager
}
Now suppose i want to retrieve list of all of assignments for a company by using hql query with subquery some thing like as below.
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=?) "
In subquery of query above, company is inner joined with locationManagerMap. I want to access key and value of this map to perform multiple column condition check. Please suggest what should be syntax in blanks in query?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它应该是这样的:
It should be something like this: