Oracle 數(shù)據(jù)庫(kù),查詢?cè)黾?a href="/article/57329.html">RowBounds限制查詢條數(shù),默認(rèn)是0到1000條
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
private final static int rowLimit = 1000 ; //限制查詢條數(shù) 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 限制查詢條數(shù)的實(shí)現(xiàn)代碼,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)服務(wù)器之家網(wǎng)站的支持!
原文鏈接:http://blog.csdn.net/xiaxiaorui2003/article/details/53322008