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.
|