MY list size is consist 5000 records i need to get 100 records every time from list then persist to 100 records each time up to 5000 records persist to DB how can achieve this logic?
private List<DoTempCustomers> doTempCustomers;
for(DoTempCustomers tempCustomers:doTempCustomers){
try {
temp=new TempCustomers();
BeanUtils.copyProperties(temp, doTemp);
getEntityManager().persist(temp);
}
my above code i was persist all 5000 records single for each loop.