spring-projects / spring-data-examples

Spring Data Example Projects
Apache License 2.0
5.17k stars 3.39k forks source link

spring boot data jdbc 2.7.6 saveAll as batch insert #655

Closed AleksandrNi closed 1 year ago

AleksandrNi commented 1 year ago

good day! I use spring-boot-starter-data-jdbc 2.7.6 saveAll SimpleJdbcRepository implementation is: return Streamable.of(entities).stream() // .map(this::save) // .collect(Collectors.toList());

could you please add information how to configure project to use saveAll as batch insert. Thanks!

schauder commented 1 year ago

Starting with 3.0.0 Spring Data JDBC will issue statements as batch statements as well as it can, so there is nothing to configure from the Spring Data JDBC side. Some JDBC drivers might need additional configuration, but that would be a question for their respective support channels.

I therefore don't think we need an additional example here.