Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » SQLServer pagination
SQLServer pagination [message #556536] Wed, 01 September 2010 12:49 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Jpql - order by sum ???
Next Topic:Fetch strategy tips
Goto Forum:
  


Current Time: Wed Jul 16 05:07:16 EDT 2025

Powered by FUDForum. Page generated in 0.07175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top