-->
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: need query help; subqueries with collections, elements()?
PostPosted: Tue Nov 15, 2005 6:06 pm 
Beginner
Beginner

Joined: Thu Feb 03, 2005 10:42 pm
Posts: 30
I do not understand the use of the elements hsql key word. I am trying to form a query that compares to sets of data to see if there is a match:

I have a person which has groups and I have a user which has groups. The groups can either be active or inactive. I am trying to query for all persons that has any matching group from my user entity.

So one try:
from Person person where elemetns(from person.groups where person.groups.active = true) in elements(?)

then i set the parameter to user.getGroups()

That don't work. I have tried a million other variations, but honestly I am confused as to the best way to structure this query. Help appreciated. Essentially the idea is that i have the user object already and need a whole bunch of persons that have an intersection of the groups collection.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.