I am using JPA 2, Hibernate 3.5.3 and have an entity with a collection of primitives (Strings) mapped via ElementCollection. I'd like to construct a JPAQL query that includes a "if in collection" clause.
My entity is like this:
[code]
public class Group {
@ElementCollection @CollectionTable(name = "GRP_MEMBER") private List<String> members;
// other properties } [/code]
Here are the queries I've tried so far: select g from Group g where g.members = :personKey select g from Group g, in(g.members) member where member = :personKey select g from Group g join g.members member where member = :personKey
The first one fails because of a type mismatch since members is a collection and personKey is a String. The later two fail because "member" is seen as an invalid token.
Is there a way to do what I'm trying to do?
|