File tree Expand file tree Collapse file tree
trunk/gcloud-java-datastore/src
main/java/com/google/gcloud/datastore
test/java/com/google/gcloud/datastore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2- refs/heads/master: a2e60abf83d6603ecf9f0e80b0c95082e8ce0fbb
2+ refs/heads/master: 2219c82af21997fe66b952b062ff7fe7006503b9
33refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
Original file line number Diff line number Diff line change @@ -35,9 +35,8 @@ public interface QueryResults<V> extends Iterator<V> {
3535 Class <?> resultClass ();
3636
3737 /**
38- * Returns the Cursor for the point after the value returned in the last {@link #next} call. Until
39- * v1beta3 is supported, this field should only be used if you have set a limit and the number of
40- * results is equal to that limit.
38+ * Returns the Cursor for the point after the value returned in the last {@link #next} call.
39+ * Currently, {@code cursorAfter} returns null in all cases but the last result.
4140 */
4241 Cursor cursorAfter ();
4342}
Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ public Class<?> resultClass() {
100100 @ Override
101101 public Cursor cursorAfter () {
102102 //return new Cursor(cursor); // only available in v1beta3
103- return new Cursor (queryResultBatchPb .getEndCursor ());
103+ if (!hasNext ()) {
104+ return new Cursor (queryResultBatchPb .getEndCursor ());
105+ }
106+ return null ;
104107 }
105108}
Original file line number Diff line number Diff line change @@ -478,7 +478,7 @@ public void testQueryPaginationWithLimit() throws DatastoreRpcException {
478478 }
479479 EasyMock .replay (rpcFactoryMock , rpcMock );
480480 Datastore mockDatastore =
481- this . options .toBuilder ()
481+ options .toBuilder ()
482482 .retryParams (RetryParams .defaultInstance ())
483483 .serviceRpcFactory (rpcFactoryMock )
484484 .build ()
You can’t perform that action at this time.
0 commit comments