Hibernate version: 3.1
Mapping documents: N/A
Code between sessionFactory.openSession() and session.close():
criteria = /*creating criteria */
...
criteria.setFirstResult(1);
criteria.setMaxResults(50)
...
Full stack trace of any exception that occurs: N/A
Name and version of the database you are using: Sybase SQL anywhere 10.0.2
The generated SQL (show_sql=true): N/A
Debug level Hibernate log excerpt: N/A
Although hibernate API allow paging support the above API , and this API functioning : I.e. returning the page size results only , Hibernate loads all the data from Sybase since Sybase and its hibernate dialects declares that not supporting SQL 'limit' function.
My Issues are:
1. Why hibernate loads and creates POJOs although the page size is set?
If it will return only the page size , why Hibernate builds all the results set objects?
I've monitored the performance through a performance tunning tool , and I've seen that the POJOs number that were created and populated was as the size of the criteria result size and not as the page size.
2. Will hibernate allow other support than SQL limit function for paging.
Sybase allow pagination through temporary tables:
http://forum.softpedia.com/index.php?showtopic=150162
I've implemented this outside of hibernate using hibernate code but it's of course a hack and not a long term solution.
I would suggest to add a Hook to implement it in a hibernate low level code calling the dialect / or other query callback before calling the JDBC layer.
Maybe there is such a callback out there?
Thanks,
Yossi