public static interface Datastore.OperationResult extends Serializable
Datastore operation, providing informatons about the operation outcome.| Modifier and Type | Interface and Description |
|---|---|
static interface |
Datastore.OperationResult.Builder
Datastore.OperationResult builder. |
| Modifier and Type | Method and Description |
|---|---|
static Datastore.OperationResult.Builder |
builder()
Get a builder to create
Datastore.OperationResult instances. |
long |
getAffectedCount()
Get the number of elements affected by the the operation execution.
|
default Optional<Object> |
getFirstInsertedKey()
Get the first inserted key value, if available.
|
default <T> Optional<T> |
getFirstInsertedKey(Class<T> targetType)
Get the first inserted key value given target type, if available.
|
<T> Optional<T> |
getInsertedKey(Path<T> path)
For
Datastore.OperationType.INSERT operations, returns the inserted key value which correspond to given
path name, if available. |
Map<Path<?>,Object> |
getInsertedKeys()
For
Datastore.OperationType.INSERT operations, returns the inserted key values, if the concrete
Datastore implementation supports this feature. |
Optional<Datastore.OperationType> |
getOperationType()
Get the executed operation type, if available.
|
Optional<Datastore.OperationType> getOperationType()
long getAffectedCount()
Map<Path<?>,Object> getInsertedKeys()
Datastore.OperationType.INSERT operations, returns the inserted key values, if the concrete
Datastore implementation supports this feature. The returned Map key set is composed by the
key Paths, associated with their values.
This method can be used, for example, to obtain the auto-generated key values, if the concrete persistence store supports this feature.
The key value type is a generic Object, it is up to the caller to convert the value to the expected
actual type.
Paths and their values, if available. An empty map if the operation is
not a Datastore.OperationType.INSERT type operation or if the concrete Datastore implementation
does not support this feature<T> Optional<T> getInsertedKey(Path<T> path)
Datastore.OperationType.INSERT operations, returns the inserted key value which correspond to given
path name, if available.T - Key typepath - Path for which to obtain the inserted key valueClassCastException - If the key value type is not compatible with the path typedefault Optional<Object> getFirstInsertedKey()
default <T> Optional<T> getFirstInsertedKey(Class<T> targetType)
T - Expected value typetargetType - Expected value type (not null)static Datastore.OperationResult.Builder builder()
Datastore.OperationResult instances.Copyright © 2019 The Holon Platform. All rights reserved.