org.springframework.orm.jpa.support
public class: SharedEntityManagerBean [javadoc |
source]
java.lang.Object
org.springframework.orm.jpa.EntityManagerFactoryAccessor
org.springframework.orm.jpa.support.SharedEntityManagerBean
All Implemented Interfaces:
FactoryBean, InitializingBean
FactoryBean that exposes a shared JPA
javax.persistence.EntityManager
reference for a given EntityManagerFactory. Typically used for an EntityManagerFactory
created by
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean ,
as direct alternative to a JNDI lookup for a Java EE 5 server's EntityManager reference.
The shared 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.
Can be passed to DAOs that expect a shared EntityManager reference rather than an
EntityManagerFactory. Note that Spring's org.springframework.orm.jpa.JpaTransactionManager
always needs an EntityManagerFactory in order to create new transactional EntityManager instances.
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |