com.holonplatform.jpa.spring.internal

## Class DefaultSpringEntityManagerLifecycleHandler

- java.lang.Object
- - com.holonplatform.jpa.spring.internal.DefaultSpringEntityManagerLifecycleHandler

- All Implemented Interfaces:
    JpaDatastore.EntityManagerFinalizer, JpaDatastore.EntityManagerInitializer, JpaDatastore.EntityManagerLifecycleHandler, SpringEntityManagerLifecycleHandler

      public class DefaultSpringEntityManagerLifecycleHandler
      extends Object
      implements SpringEntityManagerLifecycleHandler

  An `JpaDatastore.EntityManagerInitializer` and `JpaDatastore.EntityManagerFinalizer` for Spring integration, which uses `SharedEntityManagerCreator` to provide a Spring managed `EntityManager` proxy.
  Since:
    5.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultSpringEntityManagerLifecycleHandler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `finalizeEntityManager(javax.persistence.EntityManager entityManager)` Get/create the `EntityManager` instance to use when executing a Datastore operation
    `javax.persistence.EntityManager` | `getEntityManager(javax.persistence.EntityManagerFactory entityManagerFactory)` Get/create the `EntityManager` instance to use when executing a Datastore operation

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

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

    - ### Methods inherited from interface com.holonplatform.jpa.spring.SpringEntityManagerLifecycleHandler

      `create`

    - ### Methods inherited from interface com.holonplatform.datastore.jpa.JpaDatastore.EntityManagerInitializer

      `createDefault`

    - ### Methods inherited from interface com.holonplatform.datastore.jpa.JpaDatastore.EntityManagerFinalizer

      `createDefault`

- - ### Constructor Detail

    - #### DefaultSpringEntityManagerLifecycleHandler

          public DefaultSpringEntityManagerLifecycleHandler()

  - ### Method Detail

    - #### getEntityManager

          public javax.persistence.EntityManager getEntityManager(javax.persistence.EntityManagerFactory entityManagerFactory)

      Description copied from interface: `JpaDatastore.EntityManagerInitializer`
      Get/create the `EntityManager` instance to use when executing a Datastore operation
      Specified by:
        `getEntityManager` in interface `JpaDatastore.EntityManagerInitializer`
      Parameters:
        `entityManagerFactory` - EntityManagerFactory bound to the Datastore
      Returns:
        EntityManager to use

    - #### finalizeEntityManager

          public void finalizeEntityManager(javax.persistence.EntityManager entityManager)

      Description copied from interface: `JpaDatastore.EntityManagerFinalizer`
      Get/create the `EntityManager` instance to use when executing a Datastore operation
      Specified by:
        `finalizeEntityManager` in interface `JpaDatastore.EntityManagerFinalizer`
      Parameters:
        `entityManager` - EntityManager to finalize

Copyright © 2019 The Holon Platform. All rights reserved.