posts - 33,  comments - 17,  trackbacks - 0
 1//用Hibernate实现分页
 2public List queryByStatus(int status, int currentPage, int lineSize)
 3            throws Exception {
 4        List all = null;
 5        String hql = "FROM Question AS q WHERE q.status=? ORDER BY q.questiontime desc";
 6        Query q = super.getSession().createQuery(hql);
 7        q.setInteger(0, status);
 8        q.setFirstResult((currentPage - 1* lineSize);
 9        q.setMaxResults(lineSize);
10        all = q.list();
11        return all;
12    }

13
posted on 2008-07-23 17:40 scea2009 阅读(201) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

<2008年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(1)

随笔分类

随笔档案

PL/SQL存储过程与函数

搜索

  •  

最新评论

阅读排行榜

评论排行榜