com.holonplatform.datastore.jpa.internal

## Class DefaultJpaDatastore.AbstractBuilder<D extends JpaDatastore,I extends DefaultJpaDatastore>

- java.lang.Object
- - com.holonplatform.datastore.jpa.internal.DefaultJpaDatastore.AbstractBuilder<D,I>

- All Implemented Interfaces:
    com.holonplatform.core.datastore.DatastoreOperations.Builder<D,JpaDatastore.Builder<D>>, com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaDatastore.Builder<D>>, JpaDatastore.Builder<D>
  Direct Known Subclasses:
    DefaultJpaDatastore.DefaultBuilder
  Enclosing class:
    DefaultJpaDatastore

      public abstract static class DefaultJpaDatastore.AbstractBuilder<D extends JpaDatastore,I extends DefaultJpaDatastore>
      extends Object
      implements JpaDatastore.Builder<D>

  Default `JpaDatastore.Builder`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractBuilder(I datastore)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JpaDatastore.Builder<D>` | `autoFlush(boolean autoFlush)` Set whether to auto-flush mode is enabled.
    `JpaDatastore.Builder<D>` | `configuration(com.holonplatform.core.datastore.DatastoreConfigProperties configuration)`
    `JpaDatastore.Builder<D>` | `dataContextId(String dataContextId)`
    `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>` | `traceEnabled(boolean trace)`
    `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`.
    `<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> JpaDatastore.Builder<D>` | `withExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

      `build`

- - ### Constructor Detail

    - #### AbstractBuilder

          public AbstractBuilder(I datastore)

  - ### Method Detail

    - #### dataContextId

          public JpaDatastore.Builder<D> dataContextId(String dataContextId)

      Specified by:
        `dataContextId` in interface `com.holonplatform.core.datastore.DatastoreOperations.Builder<D extends JpaDatastore,JpaDatastore.Builder<D extends JpaDatastore>>`

    - #### traceEnabled

          public JpaDatastore.Builder<D> traceEnabled(boolean trace)

      Specified by:
        `traceEnabled` in interface `com.holonplatform.core.datastore.DatastoreOperations.Builder<D extends JpaDatastore,JpaDatastore.Builder<D extends JpaDatastore>>`

    - #### withExpressionResolver

          public <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> JpaDatastore.Builder<D> withExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)

      Specified by:
        `withExpressionResolver` in interface `com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaDatastore.Builder<D extends JpaDatastore>>`

    - #### configuration

          public JpaDatastore.Builder<D> configuration(com.holonplatform.core.datastore.DatastoreConfigProperties configuration)

      Specified by:
        `configuration` in interface `com.holonplatform.core.datastore.DatastoreOperations.Builder<D extends JpaDatastore,JpaDatastore.Builder<D extends JpaDatastore>>`

    - #### entityManagerFactory

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

      Description copied from interface: `JpaDatastore.Builder`
      Set the `EntityManagerFactory` to use to obtain `EntityManager`s used for datastore operations.
      Specified by:
        `entityManagerFactory` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `entityManagerFactory` - The EntityManagerFactory to set (not null)
      Returns:
        this

    - #### entityManagerInitializer

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

      Description copied from interface: `JpaDatastore.Builder`
      Sets the `EntityManager` instance provider for Datastore operations execution.
      Specified by:
        `entityManagerInitializer` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `entityManagerInitializer` - the `JpaDatastore.EntityManagerInitializer` to set (not null)
      Returns:
        this

    - #### entityManagerFinalizer

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

      Description copied from interface: `JpaDatastore.Builder`
      Sets the `EntityManager` finalizer to use after Datastore operations execution.
      Specified by:
        `entityManagerFinalizer` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `entityManagerFinalizer` - the `JpaDatastore.EntityManagerFinalizer` to set
      Returns:
        this

    - #### entityManagerHandler

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

      Description copied from interface: `JpaDatastore.Builder`
      Set both the `EntityManager` initializer (instance provider) and finalizer using the `JpaDatastore.EntityManagerLifecycleHandler` convenience interface.
      Specified by:
        `entityManagerHandler` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `entityManagerHandler` - the `JpaDatastore.EntityManagerLifecycleHandler` to set (not null)
      Returns:
        this

    - #### transactionFactory

          public JpaDatastore.Builder<D> transactionFactory(JpaTransactionFactory transactionFactory)

      Description copied from interface: `JpaDatastore.Builder`
      Set a custom `JpaTransactionFactory` to be used by the Datastore to create new transactions.
      Specified by:
        `transactionFactory` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `transactionFactory` - The transaction factory to set (not null)
      Returns:
        this

    - #### platform

          public JpaDatastore.Builder<D> platform(ORMPlatform platform)

      Description copied from interface: `JpaDatastore.Builder`
      Set the `ORMPlatform` to use.

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

      Specified by:
        `platform` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `platform` - The ORM platform to set
      Returns:
        this

    - #### dialect

          public JpaDatastore.Builder<D> dialect(ORMDialect dialect)

      Description copied from interface: `JpaDatastore.Builder`
      Set the ORM dialect to use.

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

      Specified by:
        `dialect` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `dialect` - The dialect to set (not null)
      Returns:
        this

    - #### dialect

          public JpaDatastore.Builder<D> dialect(String dialectClassName)

      Description copied from interface: `JpaDatastore.Builder`
      Set the fully qualified dialect class name to use as ORM dialect.

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

      Specified by:
        `dialect` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `dialectClassName` - The dialect class name to set (not null)
      Returns:
        this

    - #### autoFlush

          public JpaDatastore.Builder<D> autoFlush(boolean autoFlush)

      Description copied from interface: `JpaDatastore.Builder`
      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`.

      Specified by:
        `autoFlush` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Parameters:
        `autoFlush` - `true` to enable the auto-flush mode, `false` to disable
      Returns:
        this

    - #### withCommodity

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

      Description copied from interface: `JpaDatastore.Builder`
      Register a `JpaDatastoreCommodityFactory`.
      Specified by:
        `withCommodity` in interface `JpaDatastore.Builder<D extends JpaDatastore>`
      Type Parameters:
        `C` - Commodity type
      Parameters:
        `commodityFactory` - The factory to register (not null)
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.