http://www.iteye.com/topic/87035
@Override
public List<Employee> listAll(int start, int step) {
// Session s = this.getHibernateTemplate().getSessionFactory().getCurrentSession();
Session s = this.getHibernateTemplate().getSessionFactory().openSession ();
// System.out.println(s);
Query q =s.createQuery("from Employee");
q.setFirstResult(start);
q.setMaxResults(step);
List l = q.list();
if(l != null)
return l;
else
return null;
}
本文介绍了一种使用Hibernate框架实现的Java方法,该方法能够完成对Employee对象的分页查询。通过设置查询起始位置及每页显示记录数,实现了高效的数据检索。
1634

被折叠的 条评论
为什么被折叠?



