Would it make any difference if I do:
@Transactional
public void processData() {
List entities = ....;
MyEntityRepository.save(entiti
From SimpleJpaRepository
:
@Transactional
public List More save(Iterable entities) {
List result = new ArrayList();
if (entities == null) {
return result;
}
for (S entity : entities) {
result.add(save(entity));
}
return result;
}
So, your second business method only shadows save(Iterable
Crud Repository method, in the sense that it iterates the list and calls entities)save(S)
on your behalf.
As long as transaction is demarcated from your processData
business method, there is no really a difference in performance or queries executed.