Google News
logo
JPA - Interview Questions
deleteAll vs deleteAllInBatch in Spring data JPA?
While deleteAll calls delete method iteratively, deleteAllInBatch method calls executeUpdate.
 
So, if there are 100 entities to be removed, deleteAll() will triggers 100 SQL queries while deleteAllInBatch() will trigger just one. This is a very important distinction, performance wise.
Advertisement