mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
16 lines
490 B
Java
16 lines
490 B
Java
// "Replace iteration with bulk 'CrudRepository.save' call" "true"
|
|
package org.springframework.data.repository;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Arrays;
|
|
|
|
interface CrudRepository<T,ID extends Serializable> {
|
|
<S extends T> Iterable<S> save(Iterable<S> entities);
|
|
<S extends T> S save(S entity);
|
|
}
|
|
|
|
public class Main {
|
|
public void test(CrudRepository<CharSequence, Integer> repo, String[] stringsToSave) {
|
|
Arrays.stream(stringsToSave).forEach(<caret>repo::save);
|
|
}
|
|
} |