如何通过Spring提供的HibernateTemplate模版,直接进行分页啊?
怎么只有设定记录数,没有设定起始坐标???
只有getHibernateTemplate().setMaxResults(int);怎么不提供起始坐标的属性呢???难道只能使用Query对象进行分页吗???
怎么只有设定记录数,没有设定起始坐标???
只有getHibernateTemplate().setMaxResults(int);怎么不提供起始坐标的属性呢???难道只能使用Query对象进行分页吗???
解决方案 »
- JAVA实现IBM MQ队列的读取和写入
- 问下lucence建索引的机制以及compass对数据库建文件索引的机制的问题?
- 小菜,刚学JSP有问题?性别处理!
- myeclipse中jsp文件如何引用css文件?
- 我要列出user表中所有记录,这里的“”应填什么?
- 简单的问题,清高手们帮忙,多谢了。
- 那里有好的论坛源代码jsp
- servlet中直接连接mysql
- 一个关于jsp的简单问题!!!!!!!
- jsp初学者问题
- hibernate struts spring 当showgoods.jsp页面首次打开时显示数据
- hibernate里面的多条件查询中的LIKE模糊查询,有哪位高手帮忙答答,急!!
/*
* 分页显示收件箱的数量
*/
public List getList(final User user, final int offset, final int rows)
throws Exception {
HibernateCallback callBack = new HibernateCallback() { public Object doInHibernate(Session session)
throws HibernateException, SQLException {
Query query = session
.createQuery("from Inbox s where s.touserid=:touserid order by s.status,s.createtime desc");
query.setFirstResult(offset);
query.setMaxResults(rows);
query.setLong("touserid", user.getId().longValue());
return query.list();
} };
return this.getHibernateTemplate().executeFind(callBack);
}满意?