com.holonplatform.core.datastore

## Interface DatastoreOperations<R,REFRESH,BI extends BulkInsertOperation<R,BI>,BU extends BulkUpdateOperation<R,BU>,BD extends BulkDeleteOperation<R,BD>,Q extends QueryBuilder<Q>>

- Type Parameters:
    `R` - Operation result type
    `REFRESH` - Refresh result type
    `BI` - Bulk insert operation type
    `BU` - Bulk update operation type
    `BD` - Bulk delete operation type
    `Q` - Query builder type
  All Known Subinterfaces:
    AsyncDatastore, Datastore

      public interface DatastoreOperations<R,REFRESH,BI extends BulkInsertOperation<R,BI>,BU extends BulkUpdateOperation<R,BU>,BD extends BulkDeleteOperation<R,BD>,Q extends QueryBuilder<Q>>

  Base interface wich represents a generic data store abstraction and provides methods to perform data manipulation operations, enabling persistent data management in a platform/vendor independent way.

  To preserve abstraction and independence from the underlying persistence context, query and persistence methods rely on the `Property` abstraction to represent data attributes and on the `PropertyBox` data container type to transport data values in both directions.

  Since:
    5.1.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `DatastoreOperations.Builder<D extends DatastoreOperations,B extends DatastoreOperations.Builder<D,B>>` Base `DatastoreOperations` instance builder.
    `static interface` | `DatastoreOperations.WriteOption` Represents a write operation option.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `BD` | `bulkDelete(DataTarget<?> target, DatastoreOperations.WriteOption... options)` Create a `BulkDeleteOperation` actuator, which can be used to configure and execute a bulk `DELETE` operation.
    `BI` | `bulkInsert(DataTarget<?> target, PropertySet<?> propertySet, DatastoreOperations.WriteOption... options)` Create a `BulkInsertOperation` actuator, which can be used to configure and execute a bulk `INSERT` operation.
    `BU` | `bulkUpdate(DataTarget<?> target, DatastoreOperations.WriteOption... options)` Create a `BulkUpdateOperation` actuator, which can be used to configure and execute a bulk `UPDATE` operation.
    `R` | `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.
    `R` | `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.
    `Q` | `query()` Create a `QueryBuilder` actuator, which can be used to configure and execute a query on the data managed by this Datastore.
    `REFRESH` | `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.
    `R` | `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.
    `R` | `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.

- - ### Method Detail

    - #### refresh

          REFRESH 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.
      Parameters:
        `target` - `DataTarget` to declare the data store persistent entity from which data has to be refreshed
        `propertyBox` - The data to refresh, represented using a `PropertyBox` (not null)
      Returns:
        The refresh operation result, which should provide the refreshed PropertyBox instance
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### insert

          R 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.
      Parameters:
        `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.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### update

          R 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.
      Parameters:
        `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.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### save

          R 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. The save operation semantics is: insert data if not exists, update it otherwise.
      Parameters:
        `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.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### delete

          R 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.
      Parameters:
        `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.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### bulkInsert

          BI bulkInsert(DataTarget<?> target,
                        PropertySet<?> propertySet,
                        DatastoreOperations.WriteOption... options)

      Create a `BulkInsertOperation` actuator, which can be used to configure and execute a bulk `INSERT` operation.
      Parameters:
        `target` - `DataTarget` to identify 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` values
        `options` - Optional write options. The write options are specific for each concrete `DatastoreOperations` implementation.
      Returns:
        A new bulk `INSERT` operation

    - #### bulkUpdate

          BU bulkUpdate(DataTarget<?> target,
                        DatastoreOperations.WriteOption... options)

      Create a `BulkUpdateOperation` actuator, which can be used to configure and execute a bulk `UPDATE` operation.
      Parameters:
        `target` - `DataTarget` to identify data entity to update (not null)
        `options` - Optional write options. The write options are specific for each concrete `DatastoreOperations` implementation.
      Returns:
        A new bulk `UPDATE` operation

    - #### bulkDelete

          BD bulkDelete(DataTarget<?> target,
                        DatastoreOperations.WriteOption... options)

      Create a `BulkDeleteOperation` actuator, which can be used to configure and execute a bulk `DELETE` operation.
      Parameters:
        `target` - `DataTarget` to identify data entity to delete (not null)
        `options` - Optional write options. The write options are specific for each concrete `DatastoreOperations` implementation.
      Returns:
        A new bulk `DELETE` operation

    - #### query

          Q query()

      Create a `QueryBuilder` actuator, which can be used to configure and execute a query on the data managed by this Datastore.
      Returns:
        A new query builder

Copyright © 2019 The Holon Platform. All rights reserved.