See: Description
Interface | Description |
---|---|
Batch |
An interface to represent a batch of write operations.
|
Batch.Response | |
Datastore |
An interface for Google Cloud Datastore.
|
Datastore.TransactionCallable<T> |
A callback for running with a transactional
DatastoreReaderWriter . |
DatastoreBatchWriter |
An interface to represent a batch of write operations.
|
DatastoreFactory |
An interface for Datastore factories.
|
DatastoreReader |
An interface to represent Google Cloud Datastore read operations.
|
DatastoreReaderWriter |
An interface that combines both Google Cloud Datastore read and write operations.
|
DatastoreWriter |
An interface to represent Google Cloud Datastore write operations.
|
QueryResults<V> |
The result of a Google Cloud Datastore query submission.
|
RecordQuery<V> |
An internal marker interface to represent
Query that returns the entity records. |
StructuredQuery.Builder<V> |
Interface for StructuredQuery builders.
|
Transaction |
A Google cloud datastore transaction.
|
Transaction.Response | |
ValueBuilder<V,P extends Value<V>,B extends ValueBuilder<V,P,B>> |
A common interface for Value builders.
|
Class | Description |
---|---|
AggregationQuery |
An implementation of a Google Cloud Datastore Query that returns
AggregationResults , It
can be constructed by providing a nested query (StructuredQuery or GqlQuery ) to
run the aggregations on and a set of Aggregation . |
AggregationQuery.Builder | |
AggregationResult |
Represents a result of an
AggregationQuery query submission. |
AggregationResults |
The result of an
AggregationQuery query submission. |
BaseDatastoreBatchWriter |
Base class for DatastoreBatchWriter.
|
BaseEntity<K extends IncompleteKey> |
A base class for entities (key and properties).
|
BaseEntity.Builder<K extends IncompleteKey,B extends BaseEntity.Builder<K,B>> | |
BaseKey |
Base class for keys.
|
BaseKey.Builder<B extends BaseKey.Builder<B>> |
Base class for key builders.
|
Blob |
A Google Cloud Datastore Blob.
|
BlobValue | |
BlobValue.Builder | |
BooleanValue | |
BooleanValue.Builder | |
Cursor |
A Google Cloud Datastore cursor.
|
DatastoreOptions | |
DatastoreOptions.Builder | |
DatastoreOptions.DefaultDatastoreFactory | |
DatastoreOptions.DefaultDatastoreRpcFactory | |
DoubleValue | |
DoubleValue.Builder | |
Entity |
An entity is the Google Cloud Datastore persistent data object for a specific key.
|
Entity.Builder | |
EntityQuery |
An implementation of a Google Cloud Datastore entity query that can be constructed by providing
all the specific query elements.
|
EntityQuery.Builder |
A
EntityQuery builder for queries that return Entity results. |
EntityValue | |
EntityValue.Builder | |
FullEntity<K extends IncompleteKey> |
A full entity is a
BaseEntity that holds all the properties associated with a Datastore
entity (as opposed to ProjectionEntity ). |
FullEntity.Builder<K extends IncompleteKey> | |
GqlQuery<V> |
A Google Cloud Datastore GQL query.
|
GqlQuery.Builder<V> |
A GQL query builder.
|
GqlQueryProtoPreparer | |
IncompleteKey |
An incomplete key (without a name or id).
|
IncompleteKey.Builder | |
Key |
A key that is guaranteed to be complete and could be used to reference a Google Cloud Datastore
Entity . |
Key.Builder | |
KeyFactory |
A helper for creating keys for a specific
Datastore , using its associated projectId and
namespace. |
KeyQuery |
An implementation of a Google Cloud Datastore key-only query that can be constructed by providing
all the specific query elements.
|
KeyQuery.Builder |
A
KeyQuery builder for queries that return Key results. |
KeyValue | |
KeyValue.Builder | |
LatLng |
A Google Cloud Datastore LatLng (represented by latitude and longitude in degrees).
|
LatLngValue | |
LatLngValue.Builder | |
ListValue |
A Google Cloud Datastore list value.
|
ListValue.Builder | |
LongValue | |
LongValue.Builder | |
NullValue | |
NullValue.Builder | |
PathElement |
Represents a single element in a key's path.
|
ProjectionEntity |
A projection entity is a result of a Google Cloud Datastore projection query.
|
ProjectionEntity.Builder | |
ProjectionEntityQuery |
An implementation of a Google Cloud Datastore projection entity query that can be constructed by
providing all the specific query elements.
|
ProjectionEntityQuery.Builder |
A
ProjectionEntityQuery builder for queries that return ProjectionEntity
results. |
Query<V> |
A Google Cloud Datastore query.
|
Query.ResultType<V> |
This class represents the expected type of the result.
|
RawValue | |
RawValue.Builder | |
ReadOption |
Specifies options for read operations in Datastore, namely getting/fetching entities and running
queries.
|
ReadOption.EventualConsistency |
Specifies eventual consistency for reads from Datastore.
|
ReadOption.QueryAndReadOptions<Q extends Query<?>> | |
ReadOption.ReadTime |
Reads entities as they were at the given time.
|
ReadOptionProtoPreparer | |
RetryAndTraceDatastoreRpcDecorator |
An implementation of
DatastoreRpc which acts as a Decorator and decorates the underlying
DatastoreRpc with the logic of retry and Traceability. |
StringValue | |
StringValue.Builder | |
StructuredQuery<V> |
An implementation of a Google Cloud Datastore Query that can be constructed by providing all the
specific query elements.
|
StructuredQuery.CompositeFilter |
A class representing a filter composed of a combination of other filters.
|
StructuredQuery.Filter | |
StructuredQuery.OrderBy | |
StructuredQuery.OrderBy.Direction | |
StructuredQuery.PropertyFilter |
A class representing a filter based on a single property or ancestor.
|
StructuredQueryProtoPreparer | |
TimestampValue | |
TimestampValue.Builder | |
TraceUtil |
Helper class for tracing utility.
|
TransactionExceptionHandler | |
TransactionOperationExceptionHandler | |
Value<V> |
Base class for all Google Cloud Datastore value types.
|
Enum | Description |
---|---|
AggregationQuery.Mode | |
ValueType |
The type of a Datastore property.
|
Exception | Description |
---|---|
DatastoreException |
Datastore service exception.
|
Here's a simple usage example for using google-cloud from App/Compute Engine. This example shows how to create a Datastore entity. For the complete source code see CreateEntity.java.
Datastore datastore = DatastoreOptions.getDefaultInstance().getService();
KeyFactory keyFactory = datastore.newKeyFactory().setKind("keyKind");
Key key = keyFactory.newKey("keyName");
Entity entity = Entity.newBuilder(key)
.set("name", "John Doe")
.set("age", 30)
.set("access_time", Timestamp.now())
.build();
datastore.put(entity);
This second example shows how to get and update a Datastore entity if it exists. For the complete source code see UpdateEntity.java.
Datastore datastore = DatastoreOptions.getDefaultInstance().getService();
KeyFactory keyFactory = datastore.newKeyFactory().setKind("keyKind");
Key key = keyFactory.newKey("keyName");
Entity entity = datastore.get(key);
if (entity != null) {
System.out.println("Updating access_time for " + entity.getString("name"));
entity = Entity.newBuilder(entity)
.set("access_time", Timestamp.now())
.build();
datastore.update(entity);
}
When using google-cloud from outside of App/Compute Engine, you have to specify a project ID and provide credentials.
Copyright © 2023 Google LLC. All rights reserved.