Passing parameter to HQL

hibernate

Solution

Try

query2.setParameterList("ids", ids);

Problem

I have one variable like `long[] ids = [10, 11]` and I am trying to fire query like this : ``` Query query2 = session.createQuery("update Employee e SET e.isLatest = false where e.id not in (:ids)"); query2.setParameter("ids", ids); query2.executeUpdate(); ``` But I am getting error like ``` org.postgresql.util.PSQLException: ERROR: operator does not exist: bigint <> character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. ``` How can pass array variable in `NOT IN` parameter? Or Is there any other way for handling such query ?

Original source

Related problems