public abstract class ExtendedEntityManagerCreator extends Object
Supports explicit joining of a transaction through the
joinTransaction() method ("application-managed extended
EntityManager") as well as automatic joining on each operation
("container-managed extended EntityManager").
| Constructor and Description |
|---|
ExtendedEntityManagerCreator() |
| Modifier and Type | Method and Description |
|---|---|
static javax.persistence.EntityManager |
createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerFactoryInfo emfInfo)
Create an EntityManager that can join transactions with the
joinTransaction() method, but is not automatically
managed by the container. |
static javax.persistence.EntityManager |
createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations)
Create an EntityManager that can join transactions with the
joinTransaction() method, but is not automatically
managed by the container. |
static javax.persistence.EntityManager |
createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations,
PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that can join transactions with the
joinTransaction() method, but is not automatically
managed by the container. |
static javax.persistence.EntityManager |
createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerFactoryInfo emfInfo)
Create an EntityManager that automatically joins transactions on each
operation in a transaction.
|
static javax.persistence.EntityManager |
createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations)
Create an EntityManager that automatically joins transactions on each
operation in a transaction.
|
static javax.persistence.EntityManager |
createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations,
PersistenceExceptionTranslator exceptionTranslator)
Create an EntityManager that automatically joins transactions on each
operation in a transaction.
|
static javax.persistence.EntityManager |
createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf)
Create an EntityManager that automatically joins transactions on each
operation in a transaction.
|
static javax.persistence.EntityManager |
createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf,
Map properties)
Create an EntityManager that automatically joins transactions on each
operation in a transaction.
|
public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations)
joinTransaction() method, but is not automatically
managed by the container.rawEntityManager - raw EntityManagerplusOperations - an implementation of the EntityManagerPlusOperations
interface, if those operations should be exposed (may be null)public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations,
PersistenceExceptionTranslator exceptionTranslator)
joinTransaction() method, but is not automatically
managed by the container.rawEntityManager - raw EntityManagerplusOperations - an implementation of the EntityManagerPlusOperations
interface, if those operations should be exposed (may be null)exceptionTranslator - the exception translator to use for translating
JPA commit/rollback exceptions during transaction synchronization
(may be null)public static javax.persistence.EntityManager createApplicationManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerFactoryInfo emfInfo)
joinTransaction() method, but is not automatically
managed by the container.rawEntityManager - raw EntityManageremfInfo - the EntityManagerFactoryInfo to obtain the
EntityManagerPlusOperations and PersistenceUnitInfo frompublic static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations)
rawEntityManager - raw EntityManagerplusOperations - an implementation of the EntityManagerPlusOperations
interface, if those operations should be exposed (may be null)public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerPlusOperations plusOperations,
PersistenceExceptionTranslator exceptionTranslator)
rawEntityManager - raw EntityManagerplusOperations - an implementation of the EntityManagerPlusOperations
interface, if those operations should be exposed (may be null)exceptionTranslator - the exception translator to use for translating
JPA commit/rollback exceptions during transaction synchronization
(may be null)public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManager rawEntityManager,
EntityManagerFactoryInfo emfInfo)
rawEntityManager - raw EntityManageremfInfo - the EntityManagerFactoryInfo to obtain the
EntityManagerPlusOperations and PersistenceUnitInfo frompublic static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf)
emf - the EntityManagerFactory to create the EntityManager with.
If this implements the EntityManagerFactoryInfo interface, appropriate handling
of the native EntityManagerFactory and available EntityManagerPlusOperations
will automatically apply.EntityManagerFactory.createEntityManager()public static javax.persistence.EntityManager createContainerManagedEntityManager(javax.persistence.EntityManagerFactory emf,
Map properties)
emf - the EntityManagerFactory to create the EntityManager with.
If this implements the EntityManagerFactoryInfo interface, appropriate handling
of the native EntityManagerFactory and available EntityManagerPlusOperations
will automatically apply.properties - the properties to be passed into the createEntityManager
call (may be null)EntityManagerFactory.createEntityManager(java.util.Map)Copyright © 2015. All rights reserved.