NumberUtil 改为 Numbers。
parent
b32dac3b8a
commit
aa7f10008f
|
@ -16,7 +16,7 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import xyz.zhouxy.plusone.commons.util.NumberUtil;
|
import xyz.zhouxy.plusone.commons.util.Numbers;
|
||||||
import xyz.zhouxy.plusone.exception.DataOperationResultException;
|
import xyz.zhouxy.plusone.exception.DataOperationResultException;
|
||||||
|
|
||||||
public abstract class PlusoneJdbcDaoSupport {
|
public abstract class PlusoneJdbcDaoSupport {
|
||||||
|
@ -88,19 +88,19 @@ public abstract class PlusoneJdbcDaoSupport {
|
||||||
|
|
||||||
protected final long batchUpdate(String sql, SqlParameterSource[] batchArgs) {
|
protected final long batchUpdate(String sql, SqlParameterSource[] batchArgs) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, batchArgs);
|
int[] i = this.jdbc.batchUpdate(sql, batchArgs);
|
||||||
return NumberUtil.sum(i);
|
return Numbers.sum(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <T> long batchUpdate(String sql, Stream<T> c,
|
protected final <T> long batchUpdate(String sql, Stream<T> c,
|
||||||
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
||||||
return NumberUtil.sum(i);
|
return Numbers.sum(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final <T> long batchUpdate(String sql, Collection<T> c,
|
protected final <T> long batchUpdate(String sql, Collection<T> c,
|
||||||
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
@Nonnull Function<T, SqlParameterSource> paramSourceBuilder) {
|
||||||
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder));
|
||||||
return NumberUtil.sum(i);
|
return Numbers.sum(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static final <T> void assertResultEquals(T result, T expectedValue) {
|
protected static final <T> void assertResultEquals(T result, T expectedValue) {
|
||||||
|
|
Loading…
Reference in New Issue