`

分页查询

 
阅读更多
PaginatedList re=sqlMapper.queryForPaginatedList("selectAccountById", 1,20); 实现分页查询,三个参数的说明,第一个参数:指定映射文件中的具体数据库操作的模块的id值,第二个参数:执行该查询语句时传入的参数值,该参数的类型感觉具体映射文件中的需求参数的类型一致,即parameterclass和parameterMap指定的类型。第三个参数:指定一次查询显示多少行数据,此处为int类型。
    if(re!=null){
Iterator it=((List) re).iterator();
    while(it.hasNext()){
        Account se=(Account) it.next();
        System.out.println(se.getFirstName());
    }
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics