Hiya,
Say I have this:
Code:
@ElementCollection
private Set<String> names;
How do I go about querying the set if I have multiple names?
This works for one name:
Code:
from Person where :names in elements(names)
If I have this as a HQL query:
Code:
Query query = getSessionFactory().getCurrentSession().getNamedQuery(query);
query.setProperty("names", "foobar");
query.list()
I get a result back, but if I try this:
Code:
query.setProperty("names", new String[]{"foo", "bar"});
then I get a SQL error:
Code:
ERROR org.hibernate.hql.PARSER:56 - line 1:62: unexpected token: ,
Thanks all in advance.
-=bootlaces=-