当前位置: 首页>>代码示例>>Java>>正文


Java ResultSetHandler类代码示例

本文整理汇总了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();
}
 
开发者ID:colin-lee,项目名称:mybatis-spring-support,代码行数:25,代码来源:PaginationAutoMapInterceptor.java

示例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;
	}
}
 
开发者ID:butter-fly,项目名称:belling-admin,代码行数:17,代码来源:PaginationInterceptor.java

示例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;
    }
}
 
开发者ID:xiaolongzuo,项目名称:everyone-java-blog,代码行数:11,代码来源:PageInterceptor.java

示例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;
  }
}
 
开发者ID:colin-lee,项目名称:mybatis-spring-support,代码行数:9,代码来源:PaginationAutoMapInterceptor.java

示例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();
}
 
开发者ID:quickbundle,项目名称:javasec,代码行数:14,代码来源:ScrollableResultSetHandlerInterceptor.java

示例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


注:本文中的org.apache.ibatis.executor.resultset.ResultSetHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。