分页查询

HQL方式:
Query q=session.createQuery(“from Customer c order by c.name asc”);
q.setFirstResult(0);
q.setMaxResults(10);
List result=q.list();

QBC方式:
Criteria c=session.createCriteria(Customer.class);
c.addOrder(Order.asc(“name”));
c.setFirstResult(0);
c.setMaxResults(10);
List Result=c.list();

你可能感兴趣的:(java,C++,c,C#,idea)