@@ -203,6 +203,7 @@ public class DefaultDataAccessStrategy implements DataAccessStrategy {
|
||||
.getRequiredPersistentEntity(propertyPath.getBaseProperty().getOwner().getType());
|
||||
|
||||
RelationalPersistentProperty referencingProperty = propertyPath.getLeafProperty();
|
||||
|
||||
Assert.notNull(referencingProperty, "No property found matching the PropertyPath " + propertyPath);
|
||||
|
||||
String delete = sql(rootEntity.getType()).createDeleteInByPath(propertyPath);
|
||||
|
||||
@@ -379,6 +379,7 @@ class SqlGenerator {
|
||||
* @return the statement as a {@link String}. Guaranteed to be not {@literal null}.
|
||||
*/
|
||||
String createDeleteInByPath(PersistentPropertyPath<RelationalPersistentProperty> path) {
|
||||
|
||||
return createDeleteByPathAndCriteria(new PersistentPropertyPathExtension(mappingContext, path),
|
||||
filterColumn -> filterColumn.in(getBindMarker(IDS_SQL_PARAMETER)));
|
||||
}
|
||||
|
||||
@@ -51,8 +51,7 @@ public class SaveBatchingAggregateChange<T> implements BatchingAggregateChange<T
|
||||
private final List<DbAction.InsertRoot<T>> insertRootBatchCandidates = new ArrayList<>();
|
||||
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, Map<IdValueSource, List<DbAction.Insert<Object>>>> insertActions = //
|
||||
new HashMap<>();
|
||||
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, List<DbAction.Delete<Object>>> deleteActions = //
|
||||
new HashMap<>();
|
||||
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, List<DbAction.Delete<Object>>> deleteActions = new HashMap<>();
|
||||
|
||||
SaveBatchingAggregateChange(Class<T> entityType) {
|
||||
this.entityType = entityType;
|
||||
@@ -88,9 +87,8 @@ public class SaveBatchingAggregateChange<T> implements BatchingAggregateChange<T
|
||||
deletes.forEach(consumer);
|
||||
}
|
||||
});
|
||||
insertActions.entrySet().stream().sorted(Map.Entry.comparingByKey(pathLengthComparator))
|
||||
.forEach((entry) -> entry.getValue().forEach((idValueSource, inserts) ->
|
||||
consumer.accept(new DbAction.BatchInsert<>(inserts))));
|
||||
insertActions.entrySet().stream().sorted(Map.Entry.comparingByKey(pathLengthComparator)).forEach((entry) -> entry
|
||||
.getValue().forEach((idValueSource, inserts) -> consumer.accept(new DbAction.BatchInsert<>(inserts))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user