3334353637383940414243
Person p = new Person(); p.setAge((i % 100) + 1); p.setName("name" + i); persons.add(p); if ((i % chunkSize) == 0) { personRepository.save(persons); persons.clear(); } } personRepository.save(persons); }
3738394041424344454647
if ((i % chunkSize) == 0) { personRepository.save(persons); persons.clear(); } } personRepository.save(persons); } @Override public void contextDestroyed(ServletContextEvent sce) { }