I have the following HQL query and for simplicity sake lets assume the mappings and table names are correct.
String queryString = "from entity as vv inner join vv.childentity as vis with childentityid=?";
Query query = session.createQuery(queryString);
query.setParameter(0, someVarId);
List<entity> entities = query.list();
I get the following error when attempting to execute this:
ERROR: could not bind value '12' to parameter: 1; Invalid parameter index 1.
I suspect this might be because HQL implicitly does not support binding parameters in the WITH clause. I cannot find any documentation saying that this is not supported and I RTFM.
Can anybody confirm this is true or that this is a known Hibernate bug, or a good workaround would be nice too.
EDIT: I forgot to mention that I get the same error even if using a named parameter.