标签:hql opened log session div blog view alt inf
1 public List<User> getUserList(int pageInfo) { 2 DBUtil dbutil = new DBUtil(); 3 Session session = dbutil.openSession(); 4 int pageSize = 5;//页面大小 5 int page =pageSize*(pageInfo-1);//起始的offset 6 String hql ="from User"; 7 List<User> list= session.createQuery(hql).setFirstResult(page).setMaxResults(pageSize).list(); 8 session.close(); 9 return list; 10 }
标签:hql opened log session div blog view alt inf
原文地址:http://www.cnblogs.com/changna1314/p/6849129.html