主要实现新闻发布,即时查询:
public List selectByPage(final PageBean pb) throws Exception {
return template.execute(new HibernateCallback() {
public List doInHibernate(Session session) throws HibernateException,SQLException {
List list = null;
Query query = session.createQuery("from News order by id desc");
query.setFirstResult((pb.getCurrentPageNum()-1)*pb.getPageSize());
query.setMaxResults(pb.getPageSize());
list = query.list();
return list;
}
});
}
2021-11-16 23:59:12
25.96MB
ssh
1