mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -97,6 +97,17 @@ public class StatementBuilder implements Builder<StatementWrapper> {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置SQL的"?"对应的参数
|
||||
*
|
||||
* @param params 参数列表
|
||||
* @return this
|
||||
*/
|
||||
public StatementBuilder setParamList(final List<Object> params) {
|
||||
this.boundSql.setParams(params);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否返回主键
|
||||
*
|
||||
|
@@ -12,11 +12,11 @@
|
||||
|
||||
package org.dromara.hutool.db.sql;
|
||||
|
||||
import org.dromara.hutool.core.array.ArrayUtil;
|
||||
import org.dromara.hutool.core.collection.iter.ArrayIter;
|
||||
import org.dromara.hutool.core.io.IoUtil;
|
||||
import org.dromara.hutool.core.lang.Assert;
|
||||
import org.dromara.hutool.core.lang.Opt;
|
||||
import org.dromara.hutool.core.stream.StreamUtil;
|
||||
import org.dromara.hutool.db.DbException;
|
||||
import org.dromara.hutool.db.config.DbConfig;
|
||||
import org.dromara.hutool.db.handler.ResultSetUtil;
|
||||
@@ -25,6 +25,7 @@ import org.dromara.hutool.db.handler.RsHandler;
|
||||
import java.sql.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Statement和PreparedStatement工具类
|
||||
@@ -86,7 +87,7 @@ public class StatementUtil {
|
||||
.setReturnGeneratedKey(false)
|
||||
.setSqlFilter(Opt.ofNullable(config).map(DbConfig::getSqlFilters).get())
|
||||
.setSql(sql)
|
||||
.setParams(ArrayUtil.ofArray(paramsBatch, Object.class))
|
||||
.setParamList(StreamUtil.of(paramsBatch).collect(Collectors.toList()))
|
||||
.buildForBatch();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user