public class SqlUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
SqlUtil.Dialect |
static interface |
SqlUtil.Parser
处理SQL
|
static class |
SqlUtil.SimpleParser
基础的Parser抽象类
|
| 限定符和类型 | 方法和说明 |
|---|---|
Page |
getPage(Object params)
获取分页参数
|
static Page |
getPageFromObject(Object params)
对象中获取分页参数
|
static Object |
getParamValue(org.apache.ibatis.reflection.MetaObject paramsObject,
String paramName,
boolean required)
从对象中取参数
|
boolean |
isDynamic(org.apache.ibatis.mapping.MappedStatement ms)
判断当前执行的是否为动态sql
|
void |
processCountMappedStatement(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource,
Object[] args)
处理count查询的MappedStatement
|
Object |
processPage(org.apache.ibatis.plugin.Invocation invocation)
Mybatis拦截器方法
|
void |
processPageMappedStatement(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource,
Page page,
Object[] args)
处理分页查询的MappedStatement
|
static void |
setLocalPage(Page page) |
Map |
setPageParameter(org.apache.ibatis.mapping.MappedStatement ms,
Object parameterObject,
Page page)
设置分页参数
|
void |
setProperties(Properties p) |
static void |
testSql(String dialet,
String originalSql)
测试[控制台输出]count和分页sql
|
public SqlUtil(String strDialect)
strDialect - public static void setLocalPage(Page page)
public static Object getParamValue(org.apache.ibatis.reflection.MetaObject paramsObject, String paramName, boolean required)
paramsObject - paramName - required - public Object processPage(org.apache.ibatis.plugin.Invocation invocation) throws Throwable
invocation - 拦截器入参Throwable - 抛出异常public void setProperties(Properties p)
public Map setPageParameter(org.apache.ibatis.mapping.MappedStatement ms, Object parameterObject, Page page)
parameterObject - page - public void processCountMappedStatement(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource,
Object[] args)
ms - sqlSource - args - public void processPageMappedStatement(org.apache.ibatis.mapping.MappedStatement ms,
org.apache.ibatis.mapping.SqlSource sqlSource,
Page page,
Object[] args)
ms - sqlSource - page - args - public boolean isDynamic(org.apache.ibatis.mapping.MappedStatement ms)
ms - Copyright © 2015. All rights reserved.