mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
af67ab7a89
commit
afdabc3bad
@ -13,6 +13,7 @@
|
|||||||
package org.dromara.hutool.db;
|
package org.dromara.hutool.db;
|
||||||
|
|
||||||
import org.dromara.hutool.core.func.SerFunction;
|
import org.dromara.hutool.core.func.SerFunction;
|
||||||
|
import org.dromara.hutool.db.config.DbConfig;
|
||||||
import org.dromara.hutool.db.dialect.Dialect;
|
import org.dromara.hutool.db.dialect.Dialect;
|
||||||
import org.dromara.hutool.db.ds.DSWrapper;
|
import org.dromara.hutool.db.ds.DSWrapper;
|
||||||
import org.dromara.hutool.db.handler.*;
|
import org.dromara.hutool.db.handler.*;
|
||||||
@ -44,11 +45,12 @@ public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnect
|
|||||||
* 是否支持事务
|
* 是否支持事务
|
||||||
*/
|
*/
|
||||||
protected Boolean isSupportTransaction = null;
|
protected Boolean isSupportTransaction = null;
|
||||||
|
protected DialectRunner runner;
|
||||||
|
protected DbConfig dbConfig;
|
||||||
/**
|
/**
|
||||||
* 是否大小写不敏感(默认大小写不敏感)
|
* 是否大小写不敏感(默认大小写不敏感)
|
||||||
*/
|
*/
|
||||||
protected boolean caseInsensitive = true;
|
protected boolean caseInsensitive = true;
|
||||||
protected DialectRunner runner;
|
|
||||||
|
|
||||||
// ------------------------------------------------------- Constructor start
|
// ------------------------------------------------------- Constructor start
|
||||||
|
|
||||||
@ -61,7 +63,8 @@ public abstract class AbstractDb<R extends AbstractDb<R>> extends DefaultConnect
|
|||||||
public AbstractDb(final DataSource ds, final Dialect dialect) {
|
public AbstractDb(final DataSource ds, final Dialect dialect) {
|
||||||
super(ds);
|
super(ds);
|
||||||
if(ds instanceof DSWrapper){
|
if(ds instanceof DSWrapper){
|
||||||
this.caseInsensitive = ((DSWrapper) ds).getDbConfig().isCaseInsensitive();
|
this.dbConfig = ((DSWrapper) ds).getDbConfig();
|
||||||
|
this.caseInsensitive = this.dbConfig.isCaseInsensitive();
|
||||||
}
|
}
|
||||||
this.runner = new DialectRunner(dialect);
|
this.runner = new DialectRunner(dialect);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import org.dromara.hutool.db.sql.StatementWrapper;
|
|||||||
import org.dromara.hutool.db.sql.filter.SqlLogFilter;
|
import org.dromara.hutool.db.sql.filter.SqlLogFilter;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -47,19 +46,6 @@ public class StatementUtil {
|
|||||||
return prepareStatement(conn, sqlBuilder.build(), sqlBuilder.getParamValueArray());
|
return prepareStatement(conn, sqlBuilder.build(), sqlBuilder.getParamValueArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建{@link PreparedStatement}
|
|
||||||
*
|
|
||||||
* @param conn 数据库连接
|
|
||||||
* @param sql SQL语句,使用"?"做为占位符
|
|
||||||
* @param params "?"对应参数列表
|
|
||||||
* @return {@link PreparedStatement}
|
|
||||||
* @since 3.2.3
|
|
||||||
*/
|
|
||||||
public static PreparedStatement prepareStatement(final Connection conn, final String sql, final Collection<Object> params) {
|
|
||||||
return prepareStatement(conn, sql, params.toArray(new Object[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建{@link PreparedStatement}
|
* 创建{@link PreparedStatement}
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user