1个回答
展开全部
public List<Student> getList(int firstResult,int MaxResult){
Query q = session.createQuery("sql 语句");;
q.setFirstResult(firstResult);;
q.setMaxResults(MaxResult);;
List l = q.list();;
for (int i = 0; i < l.size(); i++) {
Student stu = (Student)l.get(i);
System.out.println(stu.getStuName());
}
return l;
}
给你个简单的例题 希望能帮到你
Query q = session.createQuery("sql 语句");;
q.setFirstResult(firstResult);;
q.setMaxResults(MaxResult);;
List l = q.list();;
for (int i = 0; i < l.size(); i++) {
Student stu = (Student)l.get(i);
System.out.println(stu.getStuName());
}
return l;
}
给你个简单的例题 希望能帮到你
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询