Package com.google.cloud.datastore
Interface DatastoreReader
-
- All Known Subinterfaces:
Datastore
,DatastoreReaderWriter
,Transaction
public interface DatastoreReader
An interface to represent Google Cloud Datastore read operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<Entity>
fetch(Key... keys)
Returns a list with a value for each given key (ordered by input).Entity
get(Key key)
Iterator<Entity>
get(Key... keys)
<T> QueryResults<T>
run(Query<T> query)
Submits aQuery
and returns its result.default AggregationResults
runAggregation(AggregationQuery query)
Submits aAggregationQuery
and returnsAggregationResults
.
-
-
-
Method Detail
-
get
Entity get(Key key)
- Throws:
DatastoreException
- upon failure
-
get
Iterator<Entity> get(Key... keys)
Returns anEntity
for each givenKey
that exists in the Datastore. The order of the result is unspecified. Results are loaded lazily, so it is possible to get aDatastoreException
from the returnedIterator
'shasNext
ornext
methods.- Throws:
DatastoreException
- upon failure- See Also:
get(Key)
-
fetch
List<Entity> fetch(Key... keys)
Returns a list with a value for each given key (ordered by input).null
values are returned for nonexistent keys. When possible prefer usingget(Key...)
to avoid eagerly loading the results.
-
run
<T> QueryResults<T> run(Query<T> query)
Submits aQuery
and returns its result.- Throws:
DatastoreException
- upon failure
-
runAggregation
default AggregationResults runAggregation(AggregationQuery query)
Submits aAggregationQuery
and returnsAggregationResults
.- Throws:
DatastoreException
- upon failure
-
-