SQLServer pagination [message #556536] |
Wed, 01 September 2010 12:49  |
Eclipse User |
|
|
|
I start apologizing for creating a topic for a subject that was probably already discussed.
My fault, I haven't found a good answer.
It's about pagination with SqlServer. Does Eclipselink support it ?
If I run a JPQL query with firstResult e and maxResults setted, the sql query logged doesn't have any customization, but the result is in the desired range.
I didn't see any customization about it in the SQLServerPlatform.printSQLSelectStatement()
as I can see in other implementations.
I'm using eclipselink 1.2.0.
Thanks. Mauro.
|
|
|
Re: SQLServer pagination [message #556730 is a reply to message #556536] |
Thu, 02 September 2010 09:17  |
Eclipse User |
|
|
|
Pagination support was added to a lot of the database platforms, but not yet to SQL Server. Please log a bug for this and vote for it.
The syntax appears to be something like,
SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM sys.databases ) a WHERE row > 5 and row <= 10
If you want to give implementing it a try attach your patch to the bug. Or ask for any help here if you run into an issue.
Without the platform SQL support, EclipseLink will use the JDBC maxRows API which will limit the fetch of the rows and is quite efficient. However for the start row EclipseLink will need to scroll the ResultSet to that position, which depending on the JDBC driver may be less efficient than using platform specific SQL.
|
|
|
Powered by
FUDForum. Page generated in 0.07175 seconds