How to do bulk (multi row) inserts with JpaRepository?

To get a bulk insert with Spring Boot and Spring Data JPA you need only two things: set the option spring.jpa.properties.hibernate.jdbc.batch_size to appropriate value you need (for example: 20). use saveAll() method of your repo with the list of entities prepared for inserting. Working example is here. Regarding the transformation of the insert statement into … Read more