com.holonplatform.core.datastore.beans

## Interface BeanDatastoreOperations<R,BI extends BeanBulkInsertOperation,BU extends BeanBulkUpdateOperation,BD extends BeanBulkDeleteOperation,Q extends BeanQueryBuilder>

- Type Parameters:
    `R` - Operation result type
    `BI` - Bulk insert operation type
    `BU` - Bulk update operation type
    `BD` - Bulk delete operation type
    `Q` - Query builder type
  All Known Subinterfaces:
    BeanDatastore

      public interface BeanDatastoreOperations<R,BI extends BeanBulkInsertOperation,BU extends BeanBulkUpdateOperation,BD extends BeanBulkDeleteOperation,Q extends BeanQueryBuilder>

  Interface similar to `DatastoreOperations`, which provides the same methods using a bean class to represent the peristent entity data and the data model attributes.
  Since:
    5.1.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> BD` | `bulkDelete(Class<T> beanClass, DatastoreOperations.WriteOption... options)` Create a `BulkDeleteOperation` actuator, which can be used to configure and execute a bulk `DELETE` operation.
    `<T> BI` | `bulkInsert(Class<T> beanClass, DatastoreOperations.WriteOption... options)` Create a `BulkInsertOperation` actuator, which can be used to configure and execute a bulk `INSERT` operation.
    `<T> BU` | `bulkUpdate(Class<T> beanClass, DatastoreOperations.WriteOption... options)` Create a `BulkUpdateOperation` actuator, which can be used to configure and execute a bulk `UPDATE` operation.
    `<T> R` | `delete(T bean, DatastoreOperations.WriteOption... options)` Remove a bean instance from the data store.
    `<T> R` | `insert(T bean, DatastoreOperations.WriteOption... options)` Insert a bean instance in the data store.
    `<T> Q` | `query(Class<T> beanClass)` Create a `QueryBuilder` actuator, which can be used to configure and execute a query on the data managed by this Datastore.
    `<T> T` | `refresh(T bean)` Refresh a bean instance, updating all its properties to current value in data store.
    `<T> R` | `save(T bean, DatastoreOperations.WriteOption... options)` Save a bean instance in the data store.
    `<T> R` | `update(T bean, DatastoreOperations.WriteOption... options)` Update a bean instance in the data store.

- - ### Method Detail

    - #### refresh

          <T> T refresh(T bean)

      Refresh a bean instance, updating all its properties to current value in data store.

      The operation data target (i.e. the persistence entity identifier) is obtained by default using the bean class simple name. The `DataPath` annotation can be used on bean class to declare a specific data target name.

      The bean property names are used as data model attribute names. The `DataPath` annotation can be used on bean property fields or getter methods to specify a different data model attribute name.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `bean` - The bean instance to refresh (not null)
      Returns:
        The refreshed bean instance (not null)
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### insert

          <T> R insert(T bean,
                       DatastoreOperations.WriteOption... options)

      Insert a bean instance in the data store.

      The operation data target (i.e. the persistence entity identifier) is obtained by default using the bean class simple name. The `DataPath` annotation can be used on bean class to declare a specific data target name.

      The bean property names are used as data model attribute names. The `DataPath` annotation can be used on bean property fields or getter methods to specify a different data model attribute name.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `bean` - The bean instance to insert (not null)
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### update

          <T> R update(T bean,
                       DatastoreOperations.WriteOption... options)

      Update a bean instance in the data store.

      The operation data target (i.e. the persistence entity identifier) is obtained by default using the bean class simple name. The `DataPath` annotation can be used on bean class to declare a specific data target name.

      The bean property names are used as data model attribute names. The `DataPath` annotation can be used on bean property fields or getter methods to specify a different data model attribute name.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `bean` - The bean instance to insert (not null)
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### save

          <T> R save(T bean,
                     DatastoreOperations.WriteOption... options)

      Save a bean instance in the data store. The save operation semantics is: insert data if not exists, update it otherwise.

      The operation data target (i.e. the persistence entity identifier) is obtained by default using the bean class simple name. The `DataPath` annotation can be used on bean class to declare a specific data target name.

      The bean property names are used as data model attribute names. The `DataPath` annotation can be used on bean property fields or getter methods to specify a different data model attribute name.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `bean` - The bean instance to save (not null)
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### delete

          <T> R delete(T bean,
                       DatastoreOperations.WriteOption... options)

      Remove a bean instance from the data store.

      The operation data target (i.e. the persistence entity identifier) is obtained by default using the bean class simple name. The `DataPath` annotation can be used on bean class to declare a specific data target name.

      The bean property names are used as data model attribute names. The `DataPath` annotation can be used on bean property fields or getter methods to specify a different data model attribute name.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `bean` - The bean instance to delete (not null)
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        the operation execution result
      Throws:
        `DataAccessException` - If an error occurred during operation execution

    - #### bulkInsert

          <T> BI bulkInsert(Class<T> beanClass,
                            DatastoreOperations.WriteOption... options)

      Create a `BulkInsertOperation` actuator, which can be used to configure and execute a bulk `INSERT` operation.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - The bean class to insert
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        A new bulk `INSERT` operation

    - #### bulkUpdate

          <T> BU bulkUpdate(Class<T> beanClass,
                            DatastoreOperations.WriteOption... options)

      Create a `BulkUpdateOperation` actuator, which can be used to configure and execute a bulk `UPDATE` operation.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - The bean class to update
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        A new bulk `UPDATE` operation

    - #### bulkDelete

          <T> BD bulkDelete(Class<T> beanClass,
                            DatastoreOperations.WriteOption... options)

      Create a `BulkDeleteOperation` actuator, which can be used to configure and execute a bulk `DELETE` operation.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - The bean class to delete
        `options` - Optional write options. The write options are specific for each concrete implementation.
      Returns:
        A new bulk `DELETE` operation

    - #### query

          <T> Q query(Class<T> beanClass)

      Create a `QueryBuilder` actuator, which can be used to configure and execute a query on the data managed by this Datastore.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - The bean class to query (not null)
      Returns:
        A new query builder

Copyright © 2019 The Holon Platform. All rights reserved.