Package com.google.cloud.datastore
Interface DatastoreReader
-
- All Known Subinterfaces:
Datastore,DatastoreReaderWriter,Transaction
public interface DatastoreReaderAn 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).Entityget(Key key)Iterator<Entity>get(Key... keys)<T> QueryResults<T>run(Query<T> query)Submits aQueryand returns its result.default AggregationResultsrunAggregation(AggregationQuery query)Submits aAggregationQueryand returnsAggregationResults.
-
-
-
Method Detail
-
get
Entity get(Key key)
- Throws:
DatastoreException- upon failure
-
get
Iterator<Entity> get(Key... keys)
Returns anEntityfor each givenKeythat exists in the Datastore. The order of the result is unspecified. Results are loaded lazily, so it is possible to get aDatastoreExceptionfrom the returnedIterator'shasNextornextmethods.- 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).nullvalues 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 aQueryand returns its result.- Throws:
DatastoreException- upon failure
-
runAggregation
default AggregationResults runAggregation(AggregationQuery query)
Submits aAggregationQueryand returnsAggregationResults.- Throws:
DatastoreException- upon failure
-
-