CrudRepository and Hibernate: save(List<S>) vs save(Entity) in transaction [已关闭]
如果我这样做,会有什么不同吗:
@Transactional
public void processData() {
List<MyEntity> entities = ....;
MyEntityRepository.save(entities);
}
断续器
@Transactional
public void processData() {
List<MyEntity> entities = ....;
for (MyEntity entity : entities) {
MyEntityRepository.save(entity);
}
}
基础查询和性能有什么区别?