I get this error:
org.postgresql.util.PSQLException: No value specified for parameter 1.
For this kind of query:
UPDATE user
SET Email = 'fake.' || id::varchar || '@localhost'
WHERE Email is not null and char_length(Email)>0 and removed=false and id in (:ids)
I run this query as native query like this:
sessionFactory.getCurrentSession()
.createSQLQuery(sql)
.setParameterList("ids", ids)
.executeUpdate()
;
Seems like id::varchar is confusing Hibernate or JDBC. Any way to escape this maybe? Pretty standard Postgres syntax for type casting. Don't like casting syntax and would prefer to use this type mapping.