Skip to content

Commit cf6e174

Browse files
committed
Polishing.
Original pull request #1229
1 parent aa1610d commit cf6e174

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DefaultDataAccessStrategy.java

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public void delete(Iterable<Object> rootIds, PersistentPropertyPath<RelationalPe
203203
.getRequiredPersistentEntity(propertyPath.getBaseProperty().getOwner().getType());
204204

205205
RelationalPersistentProperty referencingProperty = propertyPath.getLeafProperty();
206+
206207
Assert.notNull(referencingProperty, "No property found matching the PropertyPath " + propertyPath);
207208

208209
String delete = sql(rootEntity.getType()).createDeleteInByPath(propertyPath);

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/SqlGenerator.java

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ String createDeleteByPath(PersistentPropertyPath<RelationalPersistentProperty> p
379379
* @return the statement as a {@link String}. Guaranteed to be not {@literal null}.
380380
*/
381381
String createDeleteInByPath(PersistentPropertyPath<RelationalPersistentProperty> path) {
382+
382383
return createDeleteByPathAndCriteria(new PersistentPropertyPathExtension(mappingContext, path),
383384
filterColumn -> filterColumn.in(getBindMarker(IDS_SQL_PARAMETER)));
384385
}

spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/SaveBatchingAggregateChange.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ public class SaveBatchingAggregateChange<T> implements BatchingAggregateChange<T
5151
private final List<DbAction.InsertRoot<T>> insertRootBatchCandidates = new ArrayList<>();
5252
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, Map<IdValueSource, List<DbAction.Insert<Object>>>> insertActions = //
5353
new HashMap<>();
54-
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, List<DbAction.Delete<Object>>> deleteActions = //
55-
new HashMap<>();
54+
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, List<DbAction.Delete<Object>>> deleteActions = new HashMap<>();
5655

5756
SaveBatchingAggregateChange(Class<T> entityType) {
5857
this.entityType = entityType;
@@ -88,9 +87,8 @@ public void forEachAction(Consumer<? super DbAction<?>> consumer) {
8887
deletes.forEach(consumer);
8988
}
9089
});
91-
insertActions.entrySet().stream().sorted(Map.Entry.comparingByKey(pathLengthComparator))
92-
.forEach((entry) -> entry.getValue().forEach((idValueSource, inserts) ->
93-
consumer.accept(new DbAction.BatchInsert<>(inserts))));
90+
insertActions.entrySet().stream().sorted(Map.Entry.comparingByKey(pathLengthComparator)).forEach((entry) -> entry
91+
.getValue().forEach((idValueSource, inserts) -> consumer.accept(new DbAction.BatchInsert<>(inserts))));
9492
}
9593

9694
@Override

0 commit comments

Comments
 (0)