I have one variable of type long[] ids = [10, 11] , and I'm trying to run a 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 get an 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 to pass array variable to NOT IN parameter? Or is there any other way to handle such a request?
source share