Class AbstractEntityManagerFactoryBean

java.lang.Object
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean
All Implemented Interfaces:
Serializable, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, FactoryBean<EntityManagerFactory>, InitializingBean, SmartInitializingSingleton, PersistenceExceptionTranslator, EntityManagerFactoryInfo
Direct Known Subclasses:
LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean

Abstract FactoryBean that creates a local JPA EntityManagerFactory instance within a Spring application context.

Encapsulates the common functionality between the different JPA bootstrap contracts (standalone as well as container).

Implements support for standard JPA configuration conventions as well as Spring's customizable JpaVendorAdapter mechanism, and controls the EntityManagerFactory's lifecycle.

This class also implements the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor, for AOP-based translation of native exceptions to Spring DataAccessExceptions. Hence, the presence of e.g. LocalEntityManagerFactoryBean automatically enables a PersistenceExceptionTranslationPostProcessor to translate JPA exceptions.

Since:
2.0
Author:
Juergen Hoeller, Rod Johnson
See Also: