File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/org/springframework/data/jpa/repository/support Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -228,13 +228,13 @@ public void deleteAllByIdInBatch(Iterable<ID> ids) {
228
228
}
229
229
230
230
if (entityInformation .hasCompositeId ()) {
231
- // XXX Hibernate just creates an empty Entity when doing the getById.
232
- // Others might do a select right away causing a big performance penalty.
233
- // See JavaDoc for getById.
231
+
234
232
List <T > entities = new ArrayList <>();
235
- ids .forEach (id -> entities .add (getById (id )));
233
+ // generate entity (proxies) without accessing the database.
234
+ ids .forEach (id -> entities .add (getReferenceById (id )));
236
235
deleteAllInBatch (entities );
237
236
} else {
237
+
238
238
String queryString = String .format (DELETE_ALL_QUERY_BY_ID_STRING , entityInformation .getEntityName (),
239
239
entityInformation .getIdAttribute ().getName ());
240
240
You can’t perform that action at this time.
0 commit comments