ibatise 之 queryForList(final String statementName, final Object parameterObj

阅读更多
  /**
   * Executes a mapped SQL SELECT statement that returns data to populate
   * a number of result objects within a certain range.
   * 

* The parameter object is generally used to supply the input * data for the WHERE clause parameter(s) of the SELECT statement. * * @param id The name of the statement to execute. * @param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.). * @param skip The number of results to ignore. * @param max The maximum number of results to return. * @return A List of result objects. * @throws java.sql.SQLException If an error occurs. */ List queryForList(String id, Object parameterObject, int skip, int max) throws SQLException;


测试,针对oracle为例,原始SQL :
select * from table

经该方法封装后的SQL:
select * from ( select row_limit.*, rownum rownum_ from (select * from table ) row_limit where rownum <= (skip+max) ) where rownum_ >max

你可能感兴趣的:(ibatise 之 queryForList(final String statementName, final Object parameterObj)