HQL 对子集合的限制
我有一个类,它有一个集合
public class Parent
{
...
ISet<Child> Children;
...
}
给定一个子名称列表,我想返回其 Children 属性包含该列表的所有项目的父母。
我设法编写了一个 HQL 查询,但它适用于单个名称,而不是整个列表:
SELECT p FROM Parent AS p JOIN p.Children AS c WHERE c.Name = 'MyName'
I have a class which has a collection
public class Parent
{
...
ISet<Child> Children;
...
}
Given a list of child names, I'd like to return parents whose Children property contains all items of this list.
I managed to write an HQL query, but it works for a single name, not a whole list :
SELECT p FROM Parent AS p JOIN p.Children AS c WHERE c.Name = 'MyName'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
谢谢毛里西奥,我设法通过以下条件查询解决了这个问题
Thanks Mauricio, I managed to solve this problem with the following criteria query