com.holonplatform.datastore.jpa

## Interface JpaDatastore.Builder<D extends JpaDatastore>

- All Superinterfaces:
    com.holonplatform.core.datastore.DatastoreOperations.Builder<D,JpaDatastore.Builder<D>>, com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaDatastore.Builder<D>>
  All Known Implementing Classes:
    DefaultJpaDatastore.AbstractBuilder, DefaultJpaDatastore.DefaultBuilder
  Enclosing interface:
    JpaDatastore

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

  `JpaDatastore` builder.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `JpaDatastore.Builder<D>` | `autoFlush(boolean autoFlush)` Set whether to auto-flush mode is enabled.
    `JpaDatastore.Builder<D>` | `dialect(ORMDialect dialect)` Set the ORM dialect to use.
    `JpaDatastore.Builder<D>` | `dialect(String dialectClassName)` Set the fully qualified dialect class name to use as ORM dialect.
    `JpaDatastore.Builder<D>` | `entityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)` Set the `EntityManagerFactory` to use to obtain `EntityManager`s used for datastore operations.
    `JpaDatastore.Builder<D>` | `entityManagerFinalizer(JpaDatastore.EntityManagerFinalizer entityManagerFinalizer)` Sets the `EntityManager` finalizer to use after Datastore operations execution.
    `JpaDatastore.Builder<D>` | `entityManagerHandler(JpaDatastore.EntityManagerLifecycleHandler entityManagerHandler)` Set both the `EntityManager` initializer (instance provider) and finalizer using the `JpaDatastore.EntityManagerLifecycleHandler` convenience interface.
    `JpaDatastore.Builder<D>` | `entityManagerInitializer(JpaDatastore.EntityManagerInitializer entityManagerInitializer)` Sets the `EntityManager` instance provider for Datastore operations execution.
    `JpaDatastore.Builder<D>` | `platform(ORMPlatform platform)` Set the `ORMPlatform` to use.
    `JpaDatastore.Builder<D>` | `transactionFactory(JpaTransactionFactory transactionFactory)` Set a custom `JpaTransactionFactory` to be used by the Datastore to create new transactions.
    `<C extends com.holonplatform.core.datastore.DatastoreCommodity> JpaDatastore.Builder<D>` | `withCommodity(JpaDatastoreCommodityFactory<C> commodityFactory)` Register a `JpaDatastoreCommodityFactory`.

    - ### 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

    - #### entityManagerFactory

          JpaDatastore.Builder<D> entityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)

      Set the `EntityManagerFactory` to use to obtain `EntityManager`s used for datastore operations.
      Parameters:
        `entityManagerFactory` - The EntityManagerFactory to set (not null)
      Returns:
        this

    - #### entityManagerInitializer

          JpaDatastore.Builder<D> entityManagerInitializer(JpaDatastore.EntityManagerInitializer entityManagerInitializer)

      Sets the `EntityManager` instance provider for Datastore operations execution.
      Parameters:
        `entityManagerInitializer` - the `JpaDatastore.EntityManagerInitializer` to set (not null)
      Returns:
        this

    - #### entityManagerFinalizer

          JpaDatastore.Builder<D> entityManagerFinalizer(JpaDatastore.EntityManagerFinalizer entityManagerFinalizer)

      Sets the `EntityManager` finalizer to use after Datastore operations execution.
      Parameters:
        `entityManagerFinalizer` - the `JpaDatastore.EntityManagerFinalizer` to set
      Returns:
        this

    - #### entityManagerHandler

          JpaDatastore.Builder<D> entityManagerHandler(JpaDatastore.EntityManagerLifecycleHandler entityManagerHandler)

      Set both the `EntityManager` initializer (instance provider) and finalizer using the `JpaDatastore.EntityManagerLifecycleHandler` convenience interface.
      Parameters:
        `entityManagerHandler` - the `JpaDatastore.EntityManagerLifecycleHandler` to set (not null)
      Returns:
        this

    - #### transactionFactory

          JpaDatastore.Builder<D> transactionFactory(JpaTransactionFactory transactionFactory)

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

    - #### platform

          JpaDatastore.Builder<D> platform(ORMPlatform platform)

      Set the `ORMPlatform` to use.

      By default, the ORM platform is auto-detected using the configured `EntityManagerFactory`.

      Parameters:
        `platform` - The ORM platform to set
      Returns:
        this

    - #### dialect

          JpaDatastore.Builder<D> dialect(ORMDialect dialect)

      Set the ORM dialect to use.

      By default, the ORM dialect is auto-detected using the configured `EntityManagerFactory`.

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

    - #### dialect

          JpaDatastore.Builder<D> dialect(String dialectClassName)

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

      By default, the ORM dialect is auto-detected using the configured `EntityManagerFactory`.

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

    - #### autoFlush

          JpaDatastore.Builder<D> autoFlush(boolean autoFlush)

      Set whether to auto-flush mode is enabled. When auto-flush mode is enabled, `EntityManager.flush()` is called after each Datastore data manipulation operation, such as `save` or `delete`.

      Default is `false`.

      Parameters:
        `autoFlush` - `true` to enable the auto-flush mode, `false` to disable
      Returns:
        this

    - #### withCommodity

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

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

Copyright © 2019 The Holon Platform. All rights reserved.