Код: Выделить всё
import org.apache.commons.lang3.tuple.Pair;
import javax.management.Query;
import java.util.List;
import java.util.function.Function;
public interface CoreDao {
void batchUpdateNamedQuery(String namedQueryName, List updatedEntities, Function
, Query> updater);
}
Код: Выделить всё
updatedEntities.stream().forEach({ ent ->
getEntityManager().createNamedQuery(namedQueryName);
updater.apply(Pair.of(ent, query).executeUpdate();
})
Подробнее здесь: https://stackoverflow.com/questions/786 ... r-as-input
Мобильная версия