I'm wondering how the hibernate paging working.
let's say I have a big result(10000 rows) need to be paged.there are functions like setFirstResult(0), setMaxResults(9) in hibernate,
1. only retrieve 10 rows from database, or
2. retrieve 10000 rows and put to a collection,then filter out first 10 rows from the collection.
if Hibernate use the 2nd way, it's still take time for each page even there is only few rows on each page
I use hibernate with Oracle,the genarated sql like:
select * from (
) where rownum <= ?
this is reasonable since Oracle has rownum.
what if others database(for ex. MS SQL server) doesn't have the similar function?