JPA like Persistence Framework for Google Cloud Datastore and Cloud Firestore
QueryResponse
to provide access to metadata of the response (QueryResponseMetadata
). This metadata can be used to determine the status of query execution/whether or not there are more results after the last cursor/limit.TransactionMode
EntityManager#newTransaction
method is overloaded to accept the desired transaction mode.EntityManager#executeInTransaction
method is overloaded to accept the desired transaction mode.TransactionalTask
interface as a Functional Interface.@Entity
, @Embeddable
and @MappedSuperClass
) can now use Builder
pattern, in addition to the previously supported Classic Java Beans pattern (a.k.a POJO). Builder pattern helps the cases where persistence objects need to be immutable or to ensure that the objects state is always valid/consistent.EntityManager
, DatastoreTransaction
, DatastoreBatch
to throw two specialized exceptions in certain cases:
EntityAlreadyExistsException
- when attempting to insert a duplicate keyEntityNotFoundException
- if the entity with the given key is not found, during an update operationMarshaller
Property
and Embedded
annotations now support defining a field as optional. When optional is set to true, and if the field is null, the corresponding property will be completely omitted when saving to the Datastore. PropertyOverride
can be used to override the optionality of fields defined in an Embeddable
or MappedSuperClass
.DatastoreStats
interface.User
may declare its Identifier as of type UserId
.EntityManager
and DatastoreTransaction
interfaces to retrieve entities by their Key (DatastoreKey
).EntityManager
interface to support ID/Key allocation.DatastoreKey
interface as Serializable
.NullPointerException
and ClassCastException
in the DatastoreProperty
Entity (part of the Metadata API).EntityManagerFactory
to allow creation of EntityManager
using advanced options such as connection timeout and read timeout. A new class, ConnectionParameters
was created for this purpose. The ConnectionParameters
class provides a standardized and consistent way to create EntityManager
either for Datastore on GCP or Datastore Emulator.ProjectedEntity
to support mapping the results of a projection query. Query Results (Entity Query or Projection Query) can either be mapped to an Entity
or ProjectedEntity
. Using ProjectedEntity
enforces additional checks (e.g. persistence of Projection Entities is disallowed).DefaultDatastoreMetadata
to catch any underlying exceptions and re-throw them as EntityManagerException
.Tenant
, lets each thread to maintain a different namespace. This allows a single instance of EntityManager
to read from/write to multiple namespaces in the Cloud Datastore.@CreatedTimestamp
and @UpdatedTimestamp
were introduced to facilitate this.DatastoreMetadata
) allows -
DatastoreAccess.update(List)
methods.QueryRequest
now support binding multiple positional parameters using the newly added var-arg method, addPositionalBindings
.DatastoreBatch.Response#getGneratedKeys()
DatastoreTransaction.Response#getGneratedKeys()