![Bulk update optimistic locking with JPA and Hibernate](https://log4dev.com/articles/bulk-update-optimistic-locking-with-jpa-and-hibernate-56/6bd8634ac5bdb672bbc801bd50bf3fc9bc0f84472ba659ee4c89ecbce2f6fc3284e83bf3a7d1a210352177b66fe3a16f2e2ccc184568849b1c483119e3428581.png)
Bulk update optimistic locking with JPA and Hibernate
Introduction In this article, we are going to see how we can adjust a bulk update statement so that it takes optimistic locking into consideration. While Hibernate has been supporting versioned HQL queries for a very long time, it’s actually very easy to achieve this goal even with standard JPQL or JPA Criteria API. Bulk update optimistic locking with JPA and Hibernate.https://t.co/OsBnhkiHQj pic.twitter.com/BFqe4uL7LS — Java (@java) December 2, 2019 Domain Model Let’s consider we have a Post entity that has a status attribute that can take three possible values: PENDING, APPROVED, and SPAM....