There are several approaches to get the size of a list.
1. select cout(*) is ok, but forces you to a new select statement
2. try using a filter
3. use scrollable resultsets:
ScrollableResult scroll = query.scroll(); scroll.afterLast(); int size = scroll.rowNumber(); scroll.beforeFirst(); |
Which approach ist best, depends on your select.
posted on 2006-09-11 15:00
R.Zeus 阅读(240)
评论(0) 编辑 收藏 所属分类:
Hibernate