public abstract class AbstractSqlExecuter extends AbstractDaoExecuter implements ISqlExecuter
| 限定符和类型 | 字段和说明 |
|---|---|
protected List<Condition> |
columns |
protected List<String> |
groupBys |
protected List<Condition> |
havings |
protected static Comparator<String> |
keyComparator
变量排序器
|
static String |
NAMED_PLACEHOLDER_PREFIX
带名称的变量占位符
|
protected static Pattern |
namedPlaceHolderPattern
带名称的变量占位符
|
protected static Pattern |
onPattern
提取on的表名
|
protected List<Object> |
params
最近一次操作的参数列表
|
static String |
PLACEHOLDER
变量占位符
|
static String |
PLACEHOLDER_REG
变量占位符正则
|
protected List<String> |
sorts |
protected String |
sql
最近一次操作生成的SQL语句
|
protected List<String> |
tables |
protected List<Condition> |
wheres |
connection| 构造器和说明 |
|---|
AbstractSqlExecuter() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
bindParams(PreparedStatement stmt) |
protected String |
buildLog()
构建日志内容
|
protected void |
buildParams(List<Condition> l) |
protected String |
buildParams(String sql,
Bean o) |
protected Condition |
buildPureSqlCondition(String sql) |
protected abstract String |
buildSql()
构建SQL语句
|
protected String |
buildSqlIn(String column,
Bean param,
Object... values) |
protected String |
buildSqlParams(Condition r) |
protected String |
buildSqlWhere() |
protected String |
buildTables() |
protected int |
executeUpdate() |
protected Bean |
executeUpdateAndGetGenerated() |
protected void |
finalize(Statement stmt) |
protected void |
finalize(Statement stmt,
ResultSet rs) |
List<Object> |
getParams()
获取最近一次操作的参数列表
|
String |
getSql()
获取最近一次操作生成的SQL语句
|
protected PreparedStatement |
prepareStatement(SqlConnection conn) |
protected PreparedStatement |
prepareStatement(SqlConnection conn,
boolean generatedKeys) |
Iterator<Bean> |
queryIterator() |
protected List<Bean> |
queryList() |
protected List<Bean> |
queryList(int row) |
boolean |
support(String dbType)
是否支持指定DB类型
|
protected List<Bean> |
toBeans(ResultSet rs) |
protected ISqlExecuter |
where(String sql) |
protected ISqlExecuter |
where(String columnOrSql,
Object valueOrBean) |
protected ISqlExecuter |
whereIf(String sql,
Bean values,
boolean condition) |
protected ISqlExecuter |
whereIf(String sql,
boolean condition) |
protected ISqlExecuter |
whereIf(String column,
Object value,
boolean condition) |
protected ISqlExecuter |
whereIn(String column,
Object... values) |
protected ISqlExecuter |
whereNotEqual(String column,
Object value) |
protected ISqlExecuter |
whereNotIn(String column,
Object... values) |
setConnectionprotected String sql
protected static Pattern namedPlaceHolderPattern
protected static Pattern onPattern
protected static Comparator<String> keyComparator
public boolean support(String dbType)
IDaoExecutersupport 在接口中 IDaoExecuterdbType - DB类型protected String buildLog()
protected List<Bean> toBeans(ResultSet rs) throws SQLException
SQLExceptionprotected void finalize(Statement stmt)
protected void bindParams(PreparedStatement stmt) throws SQLException
SQLExceptionpublic String getSql()
ISqlExecutergetSql 在接口中 ISqlExecuterpublic List<Object> getParams()
ISqlExecutergetParams 在接口中 ISqlExecuterprotected ISqlExecuter where(String sql)
protected ISqlExecuter where(String columnOrSql, Object valueOrBean)
protected ISqlExecuter whereNotEqual(String column, Object value)
protected ISqlExecuter whereIf(String sql, boolean condition)
protected ISqlExecuter whereIf(String column, Object value, boolean condition)
protected ISqlExecuter whereIf(String sql, Bean values, boolean condition)
protected ISqlExecuter whereIn(String column, Object... values)
protected ISqlExecuter whereNotIn(String column, Object... values)
protected abstract String buildSql()
protected String buildSqlWhere()
protected String buildTables()
protected PreparedStatement prepareStatement(SqlConnection conn) throws SQLException
SQLExceptionprotected PreparedStatement prepareStatement(SqlConnection conn, boolean generatedKeys) throws SQLException
SQLExceptionprotected int executeUpdate()
protected Bean executeUpdateAndGetGenerated()
Copyright © 2023. All Rights Reserved.