V - the type of the results value.public interface QueryResults<V> extends Iterator<V>
resultClass() value.
Results are loaded lazily in batches, where batch size is set by Cloud Datastore. As a result, it
is possible to get a DatastoreException upon hasNext or
next calls.| Modifier and Type | Method and Description |
|---|---|
Cursor |
cursorAfter()
Deprecated.
|
Cursor |
getCursorAfter()
Returns the Cursor for the point after the value returned in the last
Iterator.next() call. |
Class<?> |
getResultClass()
Returns the actual class of the result's values.
|
Class<?> |
resultClass()
Deprecated.
|
@Deprecated Class<?> resultClass()
Class<?> getResultClass()
@Deprecated Cursor cursorAfter()
Iterator.next() call. This
cursor can be used to issue subsequent queries (with the same constraints) that may return
additional results.
A simple use case:
Query<Entity> query = Query.newEntityQueryBuilder()
.setKind("Person")
.setFilter(PropertyFilter.eq("favoriteFood", "pizza"))
.build();
QueryResults<Entity> results = datastore.run(query);
// Consume some results (using results.next()) and do any other actions as necessary.
query = query.toBuilder().setStartCursor(results.getCursorAfter()).build();
results = datastore.run(query); // now we will iterate over all entities not yet consumed
Cursor getCursorAfter()
Iterator.next() call. This
cursor can be used to issue subsequent queries (with the same constraints) that may return
additional results.
A simple use case:
Query<Entity> query = Query.newEntityQueryBuilder()
.setKind("Person")
.setFilter(PropertyFilter.eq("favoriteFood", "pizza"))
.build();
QueryResults<Entity> results = datastore.run(query);
// Consume some results (using results.next()) and do any other actions as necessary.
query = query.toBuilder().setStartCursor(results.getCursorAfter()).build();
results = datastore.run(query); // now we will iterate over all entities not yet consumed
Copyright © 2017 Google. All rights reserved.