on-internet
← Community

HQL: Is an element of one collection in another collection?

Stack Overflow ·

I want to check whether at least one element of a collection (u.organisations) is contained in another collection (? = 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? 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: IllegalArgumentEx

Comments

Sign in or sign up to comment and upvote.

No comments yet.