作者:nnnnllll | 来源:互联网 | 2023-06-04 08:45
Iwanttocheckwhetheratleastoneelementofacollection(u.organisations)iscontainedinanoth
I want to check whether at least one element of a collection (u.organisations
) is contained in another collection (?
= excludedOrganisations):
我想检查一个集合中的至少一个元素(u.organisations)是否包含在另一个集合中(?= excludedOrganisations):
select distinct u from SystemUser u
join u.userGroups g
join u.organisations o
where 3 in elements(g.permissions) and
EACH_ELEMENT_OF(o) not in (?)
How can I express the EACH_ELEMENT_OF
with HQL?
如何用HQL表达EACH_ELEMENT_OF?
My last trial is:
我的最后一次试验是:
select distinct u from SystemUser u
join u.userGroups g
where 3 in elements(g.permissions) and
not exists (
select org from Organisation org
where org in elements(u.organisations)
and org not in (?)
)
But I get the exception:
但我得到了例外:
IllegalArgumentException occurred calling getter of Organisation.id
2 个解决方案