0

I have a list of entities. What is the best way to save it? Currently, I am using a for loop, which is taking a log of time:

List <Customer> cust:

for (Customer c: cust) {
 custRepository. save(c) 
}
Benjamin W.
  • 38,596
  • 16
  • 96
  • 104
Thomas
  • 213
  • 4
  • 15

1 Answers1

0

You can use "batch Insert" for processing amount of data Example: using JDBC preparedStatement in a batch

Phuoc Huynh
  • 642
  • 4
  • 7