Interface DatastoreReader (2.32.2)
public interface DatastoreReader
An interface to represent Google Cloud Datastore read operations.
Methods
<T>run(Query<T> query)
public abstract QueryResults<T> <T>run(Query<T> query)
Submits a Query and returns its result.
Parameter |
Name |
Description |
query |
Query<T>
|
fetch(Key[] keys)
public abstract 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 using #get(Key...) to avoid eagerly
loading the results.
Parameter |
Name |
Description |
keys |
Key[]
|
get(Key key)
public abstract Entity get(Key key)
Returns an Entity for the given Key or null
if it doesn't exist.
Parameter |
Name |
Description |
key |
Key
|
Returns |
Type |
Description |
Entity |
|
get(Key[] keys)
public abstract Iterator<Entity> get(Key[] keys)
Returns an Entity for each given Key that exists in the Datastore. The order of
the result is unspecified. Results are loaded lazily, so it is possible to get a
DatastoreException
from the returned Iterator
's hasNext or
next methods.
See Also: #get(Key)
Parameter |
Name |
Description |
keys |
Key[]
|
runAggregation(AggregationQuery query)
public abstract AggregationResults runAggregation(AggregationQuery query)
runAggregation(AggregationQuery query, ExplainOptions explainOptions)
public abstract AggregationResults runAggregation(AggregationQuery query, ExplainOptions explainOptions)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]