Introduction In this article, I’m going to show you how to write JPA Bulk Update and Delete queries using the amazing Blaze Persistence framework. Blaze Persistence is a JPA framework that allows you to build Criteria queries that are much more powerful than the standard JPA Criteria API. More, it also provides support for Keyset Pagination, which is very useful when having to navigate over large result sets.
Introduction JPA and Hibernate allow us to execute bulk update and delete queries so that we can process multiple rows that match the business use case filtering criteria. When modifying multiple records, you have two options. You could either use batch processing or bulk processing. While batch processing is useful when entities are already managed by the current Persistence Context because it can reduce the number of INSERT, UPDATE, or DELETE statements that get executed, bulk processing allows us to modify the underlying database records with a single SQL statement.
Introduction JPA Criteria API bulk update delete is a great feature that allows you to build bulk update and delete queries using the JPA 2.1 Criteria API support via CriteriaUpdate and CriteriaDelete. Because one of our community members asked me on the Hibernate forum about this topic, I decided it is a good opportunity to write about this lesser-known JPA Criteria API feature.