About JDO/JPA, I tried the same thing, and Google advised to make 2 calls: the first one is your query, the second one, which is a key-only & single item query so that it can be cheap, to check if more data is available. http://groups.google.com/group/google-appengine-java/browse_thread/thread/80f1a0314987f26b?pli=1
On Thu, May 6, 2010 at 12:18 AM, James <[email protected]> wrote: > I'm implementing some UI paging and trying to detect whether a record > exists beyond the current page (in order to show a "more" button). > > I hoped to iterate over a result set of pageSize + 1, grabbing the > cursor as I pass the item @ pageSize, and then using the existence of > the last item to know there's more to be shown. Unfortunately I can't > find a way to accomplish this using JDO. > > JDOCursorHelper.getCursor(List<T>) is documented to get the cursor for > the last item in the list, so that works as documented but doesn't > help me. > > JDOCursorHelper.getCursor(Iterator<T>) seems to be what I need, but > every Iterator that I can find to pass to it causes it to return > null. I've tried passing ((List<T>)query.execute).iterator() as well > as ((QueryResult)query.execute).iterator() and both have the same > result. > > Anyone know if there's a not-too-kludgy way to do this w/o requerying > the datastore for the additional item. Or is it easier in Objectify > (I'm considering switching)? > > Thanks much, > > James > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" 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-java?hl=en.
