|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.orm.jpa.SharedEntityManagerCreator
public abstract class SharedEntityManagerCreator
Factory for a shareable JPA EntityManager
for a given EntityManagerFactory
.
The shareable EntityManager will behave just like an EntityManager fetched from an application server's JNDI environment, as defined by the JPA specification. It will delegate all calls to the current transactional EntityManager, if any; otherwise it will fall back to a newly created EntityManager per operation.
LocalEntityManagerFactoryBean
,
JpaTransactionManager
Constructor Summary | |
---|---|
SharedEntityManagerCreator()
|
Method Summary | |
---|---|
static javax.persistence.EntityManager |
createSharedEntityManager(javax.persistence.EntityManagerFactory emf)
Create a transactional EntityManager proxy for the given EntityManagerFactory. |
static javax.persistence.EntityManager |
createSharedEntityManager(javax.persistence.EntityManagerFactory emf,
Map properties)
Create a transactional EntityManager proxy for the given EntityManagerFactory. |
static javax.persistence.EntityManager |
createSharedEntityManager(javax.persistence.EntityManagerFactory emf,
Map properties,
Class... entityManagerInterfaces)
Create a transactional EntityManager proxy for the given EntityManagerFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SharedEntityManagerCreator()
Method Detail |
---|
public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf)
emf
- the EntityManagerFactory to delegate to.
If this implements the EntityManagerFactoryInfo
interface,
appropriate handling of the native EntityManagerFactory and available
EntityManagerPlusOperations
will automatically apply.
public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf, Map properties)
emf
- the EntityManagerFactory to delegate to.
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
)
public static javax.persistence.EntityManager createSharedEntityManager(javax.persistence.EntityManagerFactory emf, Map properties, Class... entityManagerInterfaces)
emf
- EntityManagerFactory to obtain EntityManagers from as neededproperties
- the properties to be passed into the
createEntityManager
call (may be null
)entityManagerInterfaces
- the interfaces to be implemented by the
EntityManager. Allows the addition or specification of proprietary interfaces.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |