Search the web
Sign In
New User? Sign Up
SimpleORM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Update in 'franck' branch : limit/offset   Message List  
Reply | Forward Message #1544 of 1851 |
Hi,

just a note to tell I have updated simpleorm in the 'franck' branch to
(hopefully) better handle offset and limit options.

What I have done is :

1) add a setLimit(long limit) and setOffset(long offset) moethod to
SQuery. The previous way (instanciating a SPreparedStatment and passing
as a execute parameter) was too complicated for me :)

2) create three OffsetStrategy to choose from by the SDriver :
- JDBC : use scrollable ResultSet jdbc feature
- QUERY : use proprietary sql statment like 'LIMIT OFFSET' (Postgresql,
MySql)
- BULK : keep the actual implementation, that is Simpleorm will iterate
over the whole resultset and skip the n first rows

So you can :

query().eq(field,
value).ascending(field).setLimit(5).setOffset(250).execute()

to get records from 251 to 255. Specific SDriver will take care of using
the most efficient way to do so...

Right now I have set SDriveOracle to return JDBC and SDriverPostgresql
to return QUERY and implement LIMIT OFFSET sql.

Regards,

Franck





Fri Mar 7, 2008 10:15 am

routier_franck
Offline Offline
Send Email Send Email

Forward
Message #1544 of 1851 |
Expand Messages Author Sort by Date

Hi, just a note to tell I have updated simpleorm in the 'franck' branch to (hopefully) better handle offset and limit options. What I have done is : 1) add a...
Franck Routier
routier_franck
Offline Send Email
Mar 7, 2008
10:16 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help