I need to do bulk updates using id's in JPA but by updating different values for each row. Currently I am updating all the rows with same value as follows:
queryStm = "Update DUMMY set dlr=:dlr,time=:time,serverTime=:servertime where id IN :arrids ";
Query query = em.createNativeQuery(queryStm);
query.setParameter("arrids ",arrids );
query.setParameter("dlr", dlr);
query.setParameter("time", time);
query.setParameter("servertime", new Timestamp(new Date().getTime()));
query.executeUpdate();
But I need to update different value for time time=:time , is there any other way to do this.
I am using Postgres 9.6.2 version and using the following dependency
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>javax.ejb-api</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.3.Final</version>
</dependency>