com.cherokeesoft.db.utils.api.FunctionalUpdateModelDao Maven / Gradle / Ivy
package com.cherokeesoft.db.utils.api;
import com.cherokeesoft.db.utils.exception.DataException;
import java.util.Arrays;
import java.util.Collection;
public interface FunctionalUpdateModelDao extends UpdateModelDao {
default int batchUpdate(Collection models) throws DataException {
return batchUpdate(() -> models);
}
default int update(MODEL model) throws DataException {
return batchUpdate(Arrays.asList(model));
}
default int update(TransactionSupplier supplier) throws DataException {
return batchUpdate(Arrays.asList(supplier.get()));
}
int batchUpdate(TransactionSupplier> supplier) throws DataException;
}