I am new to Spring MVC and not much idea with JPA as well. all I want to do is to update a list of records and its working well when I loop through the list and call update on DAO.
But I dnt want to perform 100 update/insert operations or DB round trips.
Could any one please show me how to update around 100 records with batch update instead of doing the following:
Controller:
List<MyEntity> list = form.getList();
for(MyEntity e : list){
dao.update(e);
}
Dao:
public T update(T entity){
entityManager.merge(entity);
}
Is it possible, if someone could provide me a simple way to perform batch update. I would really appreciate if I get as much explaination as possible.
Thanks