本文整理汇总了Java中org.apache.ibatis.executor.resultset.ResultSetHandler类的典型用法代码示例。如果您正苦于以下问题:Java ResultSetHandler类的具体用法?Java ResultSetHandler怎么用?Java ResultSetHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResultSetHandler类属于org.apache.ibatis.executor.resultset包,在下文中一共展示了ResultSetHandler类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: intercept
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public Object intercept(Invocation invocation) throws Throwable {
final String name = invocation.getMethod().getName();
final Object target = invocation.getTarget();
if (target instanceof StatementHandler) {
pagination(invocation, (StatementHandler) target);
} else if (target instanceof Executor) {
autoMap(invocation, name);
} else if (target instanceof ResultSetHandler) {
Object result = invocation.proceed();
if (result instanceof List) {
Page page = PAGE_THREAD_LOCAL.get();
if (page != null) {
page.addAll((List) result);
PAGE_THREAD_LOCAL.remove();
return page;
}
}
return result;
}
return invocation.proceed();
}
示例2: plugin
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
/**
* 只拦截这两种类型的 <br>
* StatementHandler <br>
* ResultSetHandler
*
* @param target
* @return
*/
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler || target instanceof ResultSetHandler) {
return Plugin.wrap(target, this);
} else {
return target;
}
}
示例3: plugin
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
return Plugin.wrap(target, this);
} else if (target instanceof ResultSetHandler) {
return Plugin.wrap(target, this);
} else {
return target;
}
}
示例4: plugin
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
@Override
public Object plugin(Object target) {
if (target instanceof Executor || target instanceof StatementHandler || target instanceof ResultSetHandler) {
return Plugin.wrap(target, this);
} else {
return target;
}
}
示例5: processIntercept
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
private void processIntercept(ResultSetHandler resultSet) throws IllegalAccessException {
final RowBounds rowBounds = (RowBounds) FieldUtils.readField(resultSet, "rowBounds", true);
if (rowBounds == null) {
return;
}
if (rowBounds.getOffset() != RowBounds.NO_ROW_OFFSET) {
RowBounds newRowBounds = new RowBounds(RowBounds.NO_ROW_OFFSET, rowBounds.getLimit());
FieldUtils.writeField(resultSet, "rowBounds", newRowBounds, true);
}
}
开发者ID:andromedarabbit,项目名称:mybatis-pagination,代码行数:13,代码来源:PaginationResultSetHandlerInterceptor.java
示例6: intercept
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
public Object intercept(Invocation invocation) throws Throwable {
if(!(invocation.getTarget() instanceof ResultSetHandler)) {
return invocation.proceed();
}
ResultSetHandler resultSet = (ResultSetHandler) invocation.getTarget();
RowBounds rowBounds = (RowBounds) RmReflectHelper.getFieldValue(resultSet, "rowBounds");
//if (rowBounds.getLimit() > 0 && rowBounds.getLimit() < RowBounds.NO_ROW_LIMIT) {
RmReflectHelper.setFieldValue(resultSet, "rowBounds", new RowBounds());
//}
return invocation.proceed();
}
示例7: intercept
import org.apache.ibatis.executor.resultset.ResultSetHandler; //导入依赖的package包/类
@Override
public Object intercept(Invocation invocation) throws Throwable {
processIntercept((ResultSetHandler) invocation.getTarget());
return invocation.proceed();
}
开发者ID:andromedarabbit,项目名称:mybatis-pagination,代码行数:6,代码来源:PaginationResultSetHandlerInterceptor.java