日期:2014-05-17 浏览次数:20634 次
(List<Question>) session.createQuery("from Question q where q.teacher.id='"+teacherId+"' order by q.id asc limit "
+ pagePos + "," + pageSize).list();
select
question0_.id as id3_,
question0_.answer as answer3_,
question0_.category_id as category10_3_,
question0_.choice_a as choice3_3_,
question0_.choice_b as choice4_3_,
question0_.choice_c as choice5_3_,
question0_.choice_d as choice6_3_,
question0_.createDate as createDate3_,
question0_.teacher_id as teacher11_3_,
question0_.title as title3_,
question0_.type as type3_
from
_question question0_
where
question0_.teacher_id='50100'
order by
question0_.id asc
(List<Question>) session.createQuery("from Question q where q.teacher.id='"+teacherId+"' order by q.id asc ").setFirstResult(pagePos)这样写就可以了
.setMaxResutl(pageSize).list();