统计查询
编辑器加载中.../**
* function:统计全部资产信息总记录数
*/
public int countStore() {
int i=(Integer)hibernateTemplate.getSessionFactory().openSession().createQuery("select count(sid) from StoreEntity").uniqueResult();
return i;
}
/**
* function:带分页查询全部库存信息
*/
public List getStoreAll(int pageNow, final int pageSize) {
final int firstResult=(pageNow-1)*pageSize;
List list=hibernateTemplate.executeFind(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException,
SQLException {
List list2 = session.createQuery(hql).setFirstResult(firstResult).setMaxResults(pageSize).list();
return list2;
}
});
return list;
}