public interface Datastore extends DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>, ConfigurableDatastore, Serializable
This is the central interface to be used for persitent data management in a platform/vendor independent way.
To preserve abstraction and independence from the underlying persistence context, query and persistence methods rely
on Property
to represent data attributes and PropertyBox
to transport data values in both directions.
Extends DatastoreCommodityHandler
to support DatastoreCommodity
creation by type.
Extends ExpressionResolver.ExpressionResolverSupport
to allow ExpressionResolver
s registration, which can be used to
extend and/or customize the datastore operations.
DatastoreCommodityFactory
Modifier and Type | Interface and Description |
---|---|
static interface |
Datastore.OperationResult
Represents the result of a
Datastore operation, providing informatons about the operation outcome. |
static class |
Datastore.OperationType
Enumeration of
Datastore operation types. |
DatastoreOperations.Builder<D extends DatastoreOperations,B extends DatastoreOperations.Builder<D,B>>, DatastoreOperations.WriteOption
Modifier and Type | Method and Description |
---|---|
default BulkDelete |
bulkDelete(DataTarget<?> target,
DatastoreOperations.WriteOption... options)
Create a
BulkDelete operation, which can be used to configure and execute a bulk DELETE
operation. |
default BulkInsert |
bulkInsert(DataTarget<?> target,
PropertySet<?> propertySet,
DatastoreOperations.WriteOption... options)
Create a
BulkInsert operation, which can be used to configure and execute a bulk INSERT
operation. |
default BulkUpdate |
bulkUpdate(DataTarget<?> target,
DatastoreOperations.WriteOption... options)
Create a
BulkUpdate operation, which can be used to configure and execute a bulk UPDATE
operation. |
default Datastore.OperationResult |
delete(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Remove a
PropertyBox from the data store, using given target to denote the data store
persistent entity from which the data has to be deleted. |
default Datastore.OperationResult |
insert(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Insert a
PropertyBox in the data store, using given target to denote the data store
persistent entity into which the data has to be inserted. |
default Optional<Transactional> |
isTransactional()
Check if this Datastore is
Transactional , i.e. supports execution of transactional operations. |
default Query |
query()
Create a
Query commodity, which can be used to configure and execute a query on the data managed by this
Datastore. |
default Query |
query(DataTarget<?> target)
Create a
Query commodity, setting given target as query data target. |
default PropertyBox |
refresh(DataTarget<?> target,
PropertyBox propertyBox)
Refresh a
PropertyBox , updating all its model properties to current value in data store and using given
target to denote the data store persistent entity to use. |
default Transactional |
requireTransactional()
Requires this Datastore to be
Transactional , i.e. to support execution of transactional operations,
throwing an IllegalStateException if this Datastore is not transactional. |
default Datastore.OperationResult |
save(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Save a
PropertyBox in the data store, using given target to denote the data store persistent
entity into which the data has to be saved. |
default Datastore.OperationResult |
update(DataTarget<?> target,
PropertyBox propertyBox,
DatastoreOperations.WriteOption... options)
Update a
PropertyBox in the data store, using given target to denote the data store
persistent entity into which the data has to be updated. |
create, getAvailableCommodities, hasCommodity
addExpressionResolver, addExpressionResolvers, removeExpressionResolver
getDataContextId
default PropertyBox refresh(DataTarget<?> target, PropertyBox propertyBox)
DatastoreOperations
PropertyBox
, updating all its model properties to current value in data store and using given
target
to denote the data store persistent entity to use.refresh
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to declare the data store persistent entity from which data has to be refreshedpropertyBox
- The data to refresh, represented using a PropertyBox
(not null)default Datastore.OperationResult insert(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store
persistent entity into which the data has to be inserted.insert
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to declare the data store persistent entity into which the data has to be
inserted (not null)propertyBox
- The data to insert, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default Datastore.OperationResult update(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store
persistent entity into which the data has to be updated.update
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to declare the data store persistent entity into which the data has to be
updated (not null)propertyBox
- The data to update, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default Datastore.OperationResult save(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
in the data store, using given target
to denote the data store persistent
entity into which the data has to be saved. The save operation semantics is: insert data if not exists,
update it otherwise.save
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to declare the data store persistent entity into which the data has to be saved
(not null)propertyBox
- The data to save, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default Datastore.OperationResult delete(DataTarget<?> target, PropertyBox propertyBox, DatastoreOperations.WriteOption... options)
DatastoreOperations
PropertyBox
from the data store, using given target
to denote the data store
persistent entity from which the data has to be deleted.delete
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to declare the data store persistent entity from which the data has to be
deleted (not null)propertyBox
- The data to delete, represented using a PropertyBox
(not null)options
- Optional write options. The write options are specific for each concrete
DatastoreOperations
implementation.default BulkInsert bulkInsert(DataTarget<?> target, PropertySet<?> propertySet, DatastoreOperations.WriteOption... options)
BulkInsert
operation, which can be used to configure and execute a bulk INSERT
operation.bulkInsert
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to identify the data entity to insert (not null)propertySet
- The property set to use to perform insert operations. Only the properties contained in given
property set will be taken into account to insert the PropertyBox
valuesoptions
- Optional write options. The write options are specific for each concrete Datastore
implementation.BulkInsert
operationdefault BulkUpdate bulkUpdate(DataTarget<?> target, DatastoreOperations.WriteOption... options)
BulkUpdate
operation, which can be used to configure and execute a bulk UPDATE
operation.bulkUpdate
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to identify the data entity to update (not null)options
- Optional write options. The write options are specific for each concrete Datastore
implementation.BulkUpdate
operationdefault BulkDelete bulkDelete(DataTarget<?> target, DatastoreOperations.WriteOption... options)
BulkDelete
operation, which can be used to configure and execute a bulk DELETE
operation.bulkDelete
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
target
- DataTarget
to identify the data entity to delete (not null)options
- Optional write options. The write options are specific for each concrete Datastore
implementation.BulkDelete
operationdefault Query query()
Query
commodity, which can be used to configure and execute a query on the data managed by this
Datastore.query
in interface DatastoreOperations<Datastore.OperationResult,PropertyBox,BulkInsert,BulkUpdate,BulkDelete,Query>
Query
instance, which can be used to configure and execute a querydefault Query query(DataTarget<?> target)
Query
commodity, setting given target
as query data target.target
- Query data target (not null)Query
instance, which can be used to configure and execute a querydefault Optional<Transactional> isTransactional()
Transactional
, i.e. supports execution of transactional operations.Transactional
, or an empty Optional
otherwisedefault Transactional requireTransactional()
Transactional
, i.e. to support execution of transactional operations,
throwing an IllegalStateException
if this Datastore is not transactional.Transactional
IllegalStateException
- If this Datastore is not transactionalCopyright © 2019 The Holon Platform. All rights reserved.