com.holonplatform.datastore.jdbc

## Interface JdbcDatastore.Builder<D extends JdbcDatastore>

- Type Parameters:
    `D` - `JdbcDatastore` type
  All Superinterfaces:
    com.holonplatform.core.datastore.DatastoreOperations.Builder<D,JdbcDatastore.Builder<D>>, com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JdbcDatastore.Builder<D>>
  All Known Implementing Classes:
    DefaultJdbcDatastore.AbstractBuilder, DefaultJdbcDatastore.DefaultBuilder
  Enclosing interface:
    JdbcDatastore

      public static interface JdbcDatastore.Builder<D extends JdbcDatastore>
      extends com.holonplatform.core.datastore.DatastoreOperations.Builder<D,JdbcDatastore.Builder<D>>

  `JdbcDatastore` builder.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `JdbcDatastore.Builder<D>` | `autoCommit(boolean autoCommit)` Deprecated. Use transaction operations to manage connection auto-commit or provide a custom `JdbcConnectionHandler` for more complex situations
    `JdbcDatastore.Builder<D>` | `connectionHandler(com.holonplatform.jdbc.JdbcConnectionHandler connectionHandler)` Set a custom `JdbcConnectionHandler` to be used for Datastore JDBC connections handling.
    `JdbcDatastore.Builder<D>` | `database(com.holonplatform.jdbc.DatabasePlatform database)` Set the database platform to which the DataSource is connected.
    `JdbcDatastore.Builder<D>` | `dataSource(DataSource dataSource)` Set the `DataSource` to use.
    `JdbcDatastore.Builder<D>` | `dataSource(com.holonplatform.jdbc.DataSourceConfigProperties configuration)` Set the configuration property source to build the `DataSource` to use with the Datastore.
    `JdbcDatastore.Builder<D>` | `dialect(SQLDialect dialect)` Set the dialect to use.
    `JdbcDatastore.Builder<D>` | `dialect(String dialectClassName)` Set the fully qualified dialect class name to use as datastore dialect.
    `JdbcDatastore.Builder<D>` | `identifierResolutionStrategy(IdentifierResolutionStrategy identifierResolutionStrategy)` Set the `IdentifierResolutionStrategy`.
    `JdbcDatastore.Builder<D>` | `transactionFactory(JdbcTransactionFactory transactionFactory)` Set a custom `JdbcTransactionFactory` to be used by the Datastore to create new transactions.
    `<C extends com.holonplatform.core.datastore.DatastoreCommodity> JdbcDatastore.Builder<D>` | `withCommodity(JdbcDatastoreCommodityFactory<C> commodityFactory)` Register a `JdbcDatastoreCommodityFactory`.

    - ### Methods inherited from interface com.holonplatform.core.datastore.DatastoreOperations.Builder

      `build, configuration, dataContextId, traceEnabled`

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

      `withExpressionResolver`

- - ### Method Detail

    - #### dataSource

          JdbcDatastore.Builder<D> dataSource(DataSource dataSource)

      Set the `DataSource` to use.
      Parameters:
        `dataSource` - DataSource to set (not null)
      Returns:
        this

    - #### dataSource

          JdbcDatastore.Builder<D> dataSource(com.holonplatform.jdbc.DataSourceConfigProperties configuration)

      Set the configuration property source to build the `DataSource` to use with the Datastore.
      Parameters:
        `configuration` - DataSource configuration properties (not null)
      Returns:
        this

    - #### database

          JdbcDatastore.Builder<D> database(com.holonplatform.jdbc.DatabasePlatform database)

      Set the database platform to which the DataSource is connected.

      If `DataSourceConfigProperties` are provided, the database platform is obtained from the `DataSourceConfigProperties.PLATFORM` property or auto-detected by the datastore if the property is not specified.

      Parameters:
        `database` - Database platform to set (not null)
      Returns:
        this

    - #### dialect

          JdbcDatastore.Builder<D> dialect(SQLDialect dialect)

      Set the dialect to use.

      If a `DatabasePlatform` is provided (using `database(DatabasePlatform)` or read/detected from the DataSource configuration properties with `dataSource(DataSourceConfigProperties)`), the datastore tries to autodetect the dialect to use, if available.

      Parameters:
        `dialect` - The dialect to set (not null)
      Returns:
        this

    - #### dialect

          JdbcDatastore.Builder<D> dialect(String dialectClassName)

      Set the fully qualified dialect class name to use as datastore dialect.

      If a `DatabasePlatform` is provided (using `database(DatabasePlatform)` or read/detected from the DataSource configuration properties with `dataSource(DataSourceConfigProperties)`), the datastore tries to autodetect the dialect to use, if available.

      Parameters:
        `dialectClassName` - The dialect class name to set (not null)
      Returns:
        this

    - #### autoCommit

          @Deprecated
          JdbcDatastore.Builder<D> autoCommit(boolean autoCommit)

      Deprecated. Use transaction operations to manage connection auto-commit or provide a custom `JdbcConnectionHandler` for more complex situations
      Set whether the auto-commit mode has to be setted for connections. (default is `true`)
      Parameters:
        `autoCommit` - Whether to set connections auto-commit
      Returns:
        this

    - #### connectionHandler

          JdbcDatastore.Builder<D> connectionHandler(com.holonplatform.jdbc.JdbcConnectionHandler connectionHandler)

      Set a custom `JdbcConnectionHandler` to be used for Datastore JDBC connections handling.
      Parameters:
        `connectionHandler` - The connection handler to set (not null)
      Returns:
        this

    - #### transactionFactory

          JdbcDatastore.Builder<D> transactionFactory(JdbcTransactionFactory transactionFactory)

      Set a custom `JdbcTransactionFactory` to be used by the Datastore to create new transactions.
      Parameters:
        `transactionFactory` - The transaction factory to set (not null)
      Returns:
        this

    - #### identifierResolutionStrategy

          JdbcDatastore.Builder<D> identifierResolutionStrategy(IdentifierResolutionStrategy identifierResolutionStrategy)

      Set the `IdentifierResolutionStrategy`.

      The identifier resolution strategy is used by the datastore to perform operations which involve a `PropertyBox` and for which the `PropertyBox` identifier properties are required to match the `PropertyBox` data with the database table primary key.

      Parameters:
        `identifierResolutionStrategy` - The identifier resolution strategy to set (not null)
      Returns:
        this

    - #### withCommodity

          <C extends com.holonplatform.core.datastore.DatastoreCommodity> JdbcDatastore.Builder<D> withCommodity(JdbcDatastoreCommodityFactory<C> commodityFactory)

      Register a `JdbcDatastoreCommodityFactory`.
      Type Parameters:
        `C` - Commodity type
      Parameters:
        `commodityFactory` - The factory to register (not null)
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.