67,512
社区成员
发帖
与我相关
我的任务
分享
public class HibernateDao extends HibernateDaoSupport
public List find(final String hql, final int offset, final int pageSize) {
List list = this.getHibernateTemplate().executeFind(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException, SQLException {
List result = session.createQuery(hql).setFirstResult(offset).setMaxResults(pageSize).list();
return result;
}
});
return list;
}
}
public class HibernateDao extends HibernateDaoSupport
public List find(final String hql, final int offset, final int pageSize) {
return getSession().createQuery(hql).setFirstResult(offset).setMaxResults(pageSize).list();
}
}