public class SqlHelper extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.apache.commons.logging.Log |
log |
| 构造器和说明 |
|---|
SqlHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.apache.ibatis.mapping.BoundSql |
createNewBoundSql(org.apache.ibatis.mapping.MappedStatement mappedStatement,
Object parameterObject,
org.apache.ibatis.mapping.BoundSql boundSql,
String newSql)
根据BoundSql 创建新 BoundSql
|
static String |
generatePageSql(String sql,
Pagination<Serializable> page,
Dialect dialect)
根据数据库方言,生成特定的分页sql。
|
static int |
getCount(String sql,
Connection connection,
org.apache.ibatis.mapping.MappedStatement mappedStatement,
Object parameterObject,
org.apache.ibatis.mapping.BoundSql boundSql)
查询总纪录数。
|
static void |
setParameters(PreparedStatement ps,
org.apache.ibatis.mapping.MappedStatement mappedStatement,
org.apache.ibatis.mapping.BoundSql boundSql,
Object parameterObject)
对SQL参数(?)
|
public static void setParameters(PreparedStatement ps, org.apache.ibatis.mapping.MappedStatement mappedStatement, org.apache.ibatis.mapping.BoundSql boundSql, Object parameterObject) throws SQLException
ps - 表示预编译的 SQL 语句的对象。mappedStatement - MappedStatementboundSql - SQLparameterObject - 参数对象SQLException - 数据库异常public static int getCount(String sql, Connection connection, org.apache.ibatis.mapping.MappedStatement mappedStatement, Object parameterObject, org.apache.ibatis.mapping.BoundSql boundSql)
sql - SQL语句connection - 数据库连接mappedStatement - mappedparameterObject - 参数boundSql - boundSqlpublic static org.apache.ibatis.mapping.BoundSql createNewBoundSql(org.apache.ibatis.mapping.MappedStatement mappedStatement,
Object parameterObject,
org.apache.ibatis.mapping.BoundSql boundSql,
String newSql)
mappedStatement - the mappedStatementparameterObject - 参数对象boundSql - the boundSqlnewSql - the newSqlpublic static String generatePageSql(String sql, Pagination<Serializable> page, Dialect dialect)
sql - Mapper中的Sql语句page - 分页对象dialect - 方言类型Copyright © 2018. All rights reserved.