1
합니까 봄 - 데이터 - JPA의 CrudRepository
방법 : 같은 순서로스프링 데이터 JPA 저장 목록 엔티티 반환 목록이 같은 순서로 저장 되나요?
<S extends T> Iterable<S> save(Iterable<S> entities)
반환 목록?
@Transactional
public <S extends T> List<S> save(Iterable<S> entities) {
List<S> result = new ArrayList<S>();
if (entities == null) {
return result;
}
for (S entity : entities) {
result.add(save(entity));
}
return result;
}
당신이 방법에 목록을 전달하면 ArrayList에이 구현 정도로, 당신은 동일한 순서로 결과를 얻을 것이다 :이 버전에서
save는 목록이 아닌 단일 엔터티를 사용합니다. –
봄 데이터 jpa 버전은 무엇입니까? –
스프링 부트 1.5.8.RELEASE, spring-boot-startter-data-jpa –