-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Is an element of one collection (not) in another collection?
PostPosted: Thu Dec 09, 2010 3:44 pm 
Newbie

Joined: Fri Nov 27, 2009 12:16 pm
Posts: 3
I want to select all SystemUsers belonging to organisations, which have not downloaded a certain document.

Code:
select distinct u from SystemUser u
join u.userGroups g
where 4 in elements(g.permissions) and
not exists (
    select org from Organisation org
    where org in elements(u.organisations)
    and org not in (
        select d.downloadingOrganisations from Document d where d.id = ?
    )
)

But this results in invalid SQL:
Code:
Unexpected token: . in statement ... not in (select . from document document6_ ...


How can I write the query correctly?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.