The cursor works sort of like a like a pointer, or a bookmark, in the
index.  When you run the query it advances the pointer forwards.  It
does not simply operate via offsets on the result set.  Looks like the
range specifies how many records you want back, i.e. how far you want
it to advance the cursor.

The current implementation of cursors do not allow you to run
backwards.  There was talk about cursors supporting that feature, but
I have not heard about it six Google IO.



Robert







On Fri, Sep 17, 2010 at 16:57, Rick Horowitz <[email protected]> wrote:
> I'm finding the JDO cursor usage documentation a bit confusing.
> According to the docs at 
> http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Query_Cursors
>
> To get the initial page of results:
>
> query.setRange(0, 20); // which makes sense
>
> Then to get the second page of results, it again uses:
>
> query.setRange(0, 20); // which is confusing. Shouldn't it be
> query.setRange(20, 40) ?
>
> In addition, does the cursor allow one to specify the previous page to
> enable support for a "Previous Page" button in the user interface?
>
> Thanks. Any clarification would be very much appreciated.
>
> Rick
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to