I'm struggling to understand my error in an HQL query:
public List<Pats> getIds(List<String> patIds) {
Session session = getSession();
String hql = "from OurPats where patId = any (:patIds)";
// String hql = "from OurPats where patId in (:patIds)";
return session.createQuery(hql).setParameterList("patIds", patIds).list();
}
...the commented out line works properly, but I want the functionality of the non-working ANY comparison as patIds.size() can be greater than 2^15 (causing postgresql to break).
Judging from http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html the ANY function should work. In other forum questions people say not to use the elements function as is stipulated in the above link (I've tried with elements and I get an IDENT error). The above code produces an org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : error.
Any ideas? Thanks for help.