Hibernate:ScrollableResults + Order

时间:2016-09-18 09:47:30

标签: java hibernate

我已经用一些订单创建了Criteria:

Criteria criteria = session.createCriteria(MyEntity.class);
criteria.addOrder(Order.asc(MyEntity.SOME_PROPERTY));
ScrollableResults scrollableResults = criteria.scroll(ScrollMode.FORWARD_ONLY);
List<MyEntity> list = new ArrayList<>();
while(scrollableResults.next()) {
   list.add(scrollableResults.get(0));
}

来自list的MyEntities会按SOME_PROPERTY排序吗?

0 个答案:

没有答案