com.holonplatform.datastore.jdbc

## Interface JdbcDatastore

- All Superinterfaces:
    com.holonplatform.core.datastore.DataContextBound, com.holonplatform.core.datastore.Datastore, com.holonplatform.core.datastore.DatastoreCommodityRegistrar<JdbcDatastoreCommodityContext>, com.holonplatform.core.ExpressionResolver.ExpressionResolverSupport, Serializable
  All Known Subinterfaces:
    JdbcDatastoreCommodityContext, SpringJdbcDatastore

      public interface JdbcDatastore
      extends com.holonplatform.core.datastore.Datastore, com.holonplatform.core.datastore.DatastoreCommodityRegistrar<JdbcDatastoreCommodityContext>

  JDBC `Datastore`.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `JdbcDatastore.Builder<D extends JdbcDatastore>` `JdbcDatastore` builder.
    `static interface` | `JdbcDatastore.ConnectionOperation<R>` Represents an operation to be executed using a Datastore managed `Connection`.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.datastore.Datastore

      `com.holonplatform.core.datastore.Datastore.OperationResult, com.holonplatform.core.datastore.Datastore.OperationType, com.holonplatform.core.datastore.Datastore.WriteOption`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JdbcDatastore.Builder<JdbcDatastore>` | `builder()` Get a builder to create a `JdbcDatastore` instance.
    `<R> R` | `withConnection(JdbcDatastore.ConnectionOperation<R> operation)` Execute given `operation` using a new `Connection` provided by the Datastore and return the operation result.

    - ### Methods inherited from interface com.holonplatform.core.datastore.Datastore

      `bulkDelete, bulkInsert, bulkUpdate, create, delete, getAvailableCommodities, insert, query, refresh, save, update`

    - ### Methods inherited from interface com.holonplatform.core.ExpressionResolver.ExpressionResolverSupport

      `addExpressionResolver, getExpressionResolvers, removeExpressionResolver`

    - ### Methods inherited from interface com.holonplatform.core.datastore.DataContextBound

      `getDataContextId`

    - ### Methods inherited from interface com.holonplatform.core.datastore.DatastoreCommodityRegistrar

      `getCommodityFactoryType, registerCommodity`

- - ### Method Detail

    - #### withConnection

          <R> R withConnection(JdbcDatastore.ConnectionOperation<R> operation)

      Execute given `operation` using a new `Connection` provided by the Datastore and return the operation result.

      The connection lifecycle if managed by Datastore, performing the appropriate closing operations at the end of the `Function` execution.

      Type Parameters:
        `R` - Operation result type
      Parameters:
        `operation` - The operation to execute (not null)
      Returns:
        Operation result
      Throws:
        `IllegalStateException` - If a `DataSource` is not available or not initialized
        `com.holonplatform.core.exceptions.DataAccessException` - If an error occurred during connection management or operation execution

    - #### builder

          static JdbcDatastore.Builder<JdbcDatastore> builder()

      Get a builder to create a `JdbcDatastore` instance.
      Returns:
        Datastore builder

Copyright © 2017 The Holon Platform. All rights reserved.