-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to say all items in collection in another collection?
PostPosted: Mon Oct 19, 2009 9:44 am 
Regular
Regular

Joined: Tue May 12, 2009 6:08 am
Posts: 92
how do we say cleanly in hql something like, "select only the rows where all the elements in my collection are contained within this other collection"

when I use "object in (:collection)", it does an "OR" on the individual items so it pulls all the rows with at least one match. I basically want the opposite - only pulling if they all match.


Top
 Profile  
 
 Post subject: Re: how to say all items in collection in another collection?
PostPosted: Mon Oct 19, 2009 3:07 pm 
Newbie

Joined: Mon Oct 19, 2009 2:24 pm
Posts: 4
I just posted this same question with a detailed example of what i've tried in this thread:
https://forum.hibernate.org/viewtopic.php?f=1&t=999756

I'm interested to see if there is a solution to this.


Top
 Profile  
 
 Post subject: Re: how to say all items in collection in another collection?
PostPosted: Mon Oct 19, 2009 5:31 pm 
Regular
Regular

Joined: Tue May 12, 2009 6:08 am
Posts: 92
I've tried it in a million different ways. A few times I got the HQL to compile, but then got a SQL grammar error.

I was trying things like this (forgive the bad syntax).

Code:
(:myCollection) = all elements(o.collection)


I've tried = some and a whole bunch of other variations.

I've come to the conclusion that generating the HQL string with a string builder is probably the only way to do it.


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

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.