-
Notifications
You must be signed in to change notification settings - Fork 364
Closed
Labels
type: regressionA regression from a previous releaseA regression from a previous release
Milestone
Description
When migrating some projects to Spring Boot 3.0.1 I've noticed that there has been a change of the behavior of org.springframework.data.jdbc.repository.support.SimpleJdbcRepository::saveAll
. In the old implementation it was allowed to send an empty list to saveAll but now it will fail with an exception.
New implementation
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
return entityOperations.saveAll(entities); //Throws exception on empty list
}
Previous implementation
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
return Streamable.of(entities).stream() //
.map(this::save) //
.collect(Collectors.toList());
}
Would it maybe be possible to keep the old behavior with an early return if the list is empty? This can of course be changed in the applications that calls saveAll but I feel like it sometimes can be a quite subtle error that might be hard to spot when migrating to a new version of Spring.
Metadata
Metadata
Assignees
Labels
type: regressionA regression from a previous releaseA regression from a previous release