手机
当前位置:查字典教程网 >编程开发 >Java >Mybatis RowBounds 限制查询条数的实现代码
Mybatis RowBounds 限制查询条数的实现代码
摘要:Oracle数据库,查询增加RowBounds限制查询条数,默认是0到1000条privatefinalstaticintrowLimit=...

Oracle 数据库,查询增加RowBounds限制查询条数,默认是0到1000条

private final static int rowLimit = 1000; //限制查询条数 private final static RowBounds QUERY_LIMIT=new RowBounds(0,rowLimit); public List<T> select(String sqlID, T t) throws DBException, RecordNotFoundException { List<T> ret; try { if ("".equals(sqlID) || (null == sqlID)) { ret = getSqlSession().selectList(t.getMapperName() + SELECT, t,QUERY_LIMIT); } else { ret = getSqlSession().selectList(t.getMapperName() + MAPPER + sqlID, t,QUERY_LIMIT); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); LOGGER.debug(t.toString()); throw new DBException(e); } if (ret == null && checkNull) { throw new RecordNotFoundException(t.getTableName()); } return ret; }

以上所述是小编给大家介绍的Mybatis RowBounds 限制查询条数的实现代码,希望对大家有所帮助,如果大家有任何疑问请给我们留言,小编会及时回复大家的。在此也非常感谢大家对查字典教程网的支持!

【Mybatis RowBounds 限制查询条数的实现代码】相关文章:

java中将汉字转换成拼音的实现代码

MYSQL批量插入数据的实现代码第1/3页

通过jxl.jar 读取、导出excel的实例代码

Java(基于Struts2) 分页实现代码

Java Annotation(Java 注解)的实现代码

java 键盘输入的多种实现方法

JAVA简单链接Oracle数据库 注册和登陆功能的实现代码

Java字符串详解的实例介绍

java 图片加水印实例代码

java 重定义数组的实现方法(与VB的ReDim相像)

精品推荐
分类导航