-->
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: HQL Query Help
PostPosted: Tue Dec 13, 2005 7:43 pm 
Newbie

Joined: Wed Nov 23, 2005 1:09 pm
Posts: 6
Let's suppose that I have the following classes:

(psudo syntax)
Post {
List<Value> words;
}

Value {
String val;
}


And that they are correctly mapped. Now let's suppose I wish create a query method that that takes in a List of Strings, e.g. {"one", "two", "three"} and finds all Post objects that contain a Value object in its words property such that the value object has its var property as a member of the set of Strings. The HQL eludes me right now. What I have so far is the following:

FROM Post p WHERE COUNT(*) (FROM Value v WHERE v.val IN (:keyWords) INTERSECT p.words) > 0

This obvious is incorrect, but I hope it illustrates what I wish to accomplish. Anybody have any suggestions? I would really appreciate the help.


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.