0

I am using Spring Data Jpa with Spring Boot Application and went through link: JPA - Batch/Bulk Update - What is the better approach?, but still not clear.

In my case, Entity class is very complex and has relationship with many other entities, I simply wants to update the status to Active for few Ids and for other few Ids it should be InActive

final String update = "UPDATE User u SET u.status = 'Active' WHERE u.id IN (?1)"; 

final String update = "UPDATE User u SET u.status= 'Inactive' WHERE u.id IN (?1)";

Is there any way if we can have place holder for status and put data like below?

final String update = "UPDATE User u SET u.enabled =:status WHERE u.id IN (?1)";

Any quick suggestions please?

Jeff Cook
  • 6,762
  • 25
  • 90
  • 159

0 Answers0