|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.elca.el4j.services.persistence.hibernate.dao.HibernateSessionFactoryInjectorBeanPostProcessor
public class HibernateSessionFactoryInjectorBeanPostProcessor
Inject the session factory in GenericDaos (or other daos) if needed.
It gets the sessionFactory from the spring context
by using the default name SESSION_FACTORY_BEAN_DEFAULT_NAME
or
via its setter method.
Field Summary | |
---|---|
protected SessionFactory |
m_sessionFactory
|
static String |
SESSION_FACTORY_BEAN_DEFAULT_NAME
The default name for the property of the session factory. |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
HibernateSessionFactoryInjectorBeanPostProcessor()
|
Method Summary | |
---|---|
int |
getOrder()
|
SessionFactory |
getSessionFactory()
Gets the session factory (from spring context if needed). |
protected void |
initDao(GenericDao<?> 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 |
setOrder(int order)
|
void |
setSessionFactory(SessionFactory factory)
You can either set the session factory explicitly or have the factory load the session factory implicitly (by name). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SESSION_FACTORY_BEAN_DEFAULT_NAME
protected SessionFactory m_sessionFactory
Constructor Detail |
---|
public HibernateSessionFactoryInjectorBeanPostProcessor()
Method Detail |
---|
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
postProcessBeforeInitialization
in interface BeanPostProcessor
BeansException
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
postProcessAfterInitialization
in interface BeanPostProcessor
BeansException
protected void initDao(GenericDao<?> dao)
dao
- public SessionFactory getSessionFactory()
public void setSessionFactory(SessionFactory factory)
factory
- public void setOrder(int order)
public int getOrder()
getOrder
in interface Ordered
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |