Skip to content

Commit 8f660c5

Browse files
committed
Polishing.
Formatting. See #2414 Original pull request #2419
1 parent 314889b commit 8f660c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ public void deleteAllByIdInBatch(Iterable<ID> ids) {
228228
}
229229

230230
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+
234232
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)));
236235
deleteAllInBatch(entities);
237236
} else {
237+
238238
String queryString = String.format(DELETE_ALL_QUERY_BY_ID_STRING, entityInformation.getEntityName(),
239239
entityInformation.getIdAttribute().getName());
240240

0 commit comments

Comments
 (0)