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.
  • 46,058
  • 19
  • 106
  • 116
Thomas
  • 213
  • 5
  • 17

1 Answers1

0

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

Phuoc Huynh
  • 692
  • 4
  • 7