|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.services.persistence.jpa.dao.JpaEntityManagerFactoryInjectorBeanPostProcessor
public class JpaEntityManagerFactoryInjectorBeanPostProcessor
Inject the entity manager factory in GenericDaos (or other daos) if needed.
It gets the entityManagerFactory from the spring context
by using the default name ENTITY_MANAGER_FACTORY_BEAN_DEFAULT_NAME or
via its setter method.
| Field Summary | |
|---|---|
static String |
ENTITY_MANAGER_FACTORY_BEAN_DEFAULT_NAME
The default name for the property of the session factory. |
protected javax.persistence.EntityManagerFactory |
m_entityManagerFactory
|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
JpaEntityManagerFactoryInjectorBeanPostProcessor()
|
|
| Method Summary | |
|---|---|
javax.persistence.EntityManagerFactory |
getEntityManagerFactory()
Gets the session factory (from spring context if needed). |
int |
getOrder()
|
protected void |
initDao(ConvenienceGenericJpaDao<?,?> dao)
Try to init the sessionFactory of the bean. |
Object |
postProcessAfterInitialization(Object bean,
String beanName)
|
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
Initiates the real work. |
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setEntityManagerFactory(javax.persistence.EntityManagerFactory factory)
You can either set the session factory explicitly or have the factory load the session factory implicitly (by name). |
void |
setOrder(int order)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ENTITY_MANAGER_FACTORY_BEAN_DEFAULT_NAME
protected javax.persistence.EntityManagerFactory m_entityManagerFactory
| Constructor Detail |
|---|
public JpaEntityManagerFactoryInjectorBeanPostProcessor()
| Method Detail |
|---|
public Object postProcessBeforeInitialization(Object bean,
String beanName)
throws BeansException
postProcessBeforeInitialization in interface BeanPostProcessorBeansException
public Object postProcessAfterInitialization(Object bean,
String beanName)
throws BeansException
postProcessAfterInitialization in interface BeanPostProcessorBeansExceptionprotected void initDao(ConvenienceGenericJpaDao<?,?> dao)
dao - public javax.persistence.EntityManagerFactory getEntityManagerFactory()
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory factory)
factory - public void setOrder(int order)
public int getOrder()
getOrder in interface Ordered
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException
setApplicationContext in interface ApplicationContextAwareBeansException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||