public List findPageMessage(final String sql, final int firstRow, final int maxRow) {
return hibernatetemplate.executeFind( new HibernateCallback() {
public Object doInHibernate(Session s) throws HibernateException, SQLException {
Query query = s.createQuery(sql);
query.setFirstResult(firstRow);
query.setMaxResults(maxRow);
List list = query.list();
return list;
}
});
}
hibernate 分页