Hi. I am looking at using a hibernate query object for retrieving data from the database for use by a user interface. As such, I need the data paginated. The methods uery.setMaxResults and Query.setFirstResult look useful for this, but I do have a question:
When Hibernate returns the specified result range, does it actually generate the native SQL that specifies the result range so that the database only queries that specific range or does Hibernate get the particular whole result set regardless of range and then filter the result. If the latter, then this would not be performant for my purposes.
Thanks.
|