Hibernate分页参考

Session session = HibernateSessionFactory.getSession();
Query q = session.createQuery("from BasicUser as b");
q.setFirstResult(30);
q.setMaxResults(10);
List l = q.list();
for(int j=0;j<l.size();j++){
BasicUser bu=(BasicUser)l.get(j);
System.out.println(bu.getId()+":"+bu.getName());
}

session.close();

你可能感兴趣的:(Hibernate,J#)