Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » SQLServer pagination
SQLServer pagination [message #556536] Wed, 01 September 2010 16:49 Go to next message
Mauro Flores is currently offline Mauro FloresFriend
Messages: 84
Registered: September 2009
Location: Brasil
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 13:17 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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.

James : Wiki : Book : Blog : Twitter
Previous Topic:Jpql - order by sum ???
Next Topic:Fetch strategy tips
Goto Forum:

Current Time: Sun Jun 24 13:26:15 GMT 2018

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

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

Back to the top