| java.lang.Object org.springframework.orm.hibernate3.AbstractSessionFactoryBean
All known Subclasses: org.springframework.orm.hibernate3.LocalSessionFactoryBean,
Field Summary | |
final protected Log | logger |
Method Summary | |
public void | afterPropertiesSet() Build and expose the SessionFactory. | protected void | afterSessionFactoryCreation() Hook that allows post-processing after the SessionFactory has been
successfully created. | protected void | beforeSessionFactoryDestruction() Hook that allows shutdown processing before the SessionFactory
will be closed. | abstract protected SessionFactory | buildSessionFactory() Build the underlying Hibernate SessionFactory. | protected DataAccessException | convertHibernateAccessException(HibernateException ex) Convert the given HibernateException to an appropriate exception from the
org.springframework.dao hierarchy. | public void | destroy() Close the SessionFactory on bean factory shutdown. | public Object | getObject() Return the singleton SessionFactory. | public Class | getObjectType() | final protected SessionFactory | getSessionFactory() Return the exposed SessionFactory. | protected SessionFactory | getTransactionAwareSessionFactoryProxy(SessionFactory target) Wrap the given SessionFactory with a proxy that delegates every method call
to it but delegates getCurrentSession calls to SessionFactoryUtils,
for participating in Spring-managed transactions. | protected boolean | isExposeTransactionAwareSessionFactory() Return whether to expose a transaction-aware proxy for the SessionFactory. | public boolean | isSingleton() | public void | setExposeTransactionAwareSessionFactory(boolean exposeTransactionAwareSessionFactory) Set whether to expose a transaction-aware proxy for the SessionFactory,
returning the Session that's associated with the current Spring-managed
transaction on getCurrentSession() , if any.
Default is "true", letting data access code work with the plain
Hibernate SessionFactory and its getCurrentSession() method,
while still being able to participate in current Spring-managed transactions:
with any transaction management strategy, either local or JTA / EJB CMT,
and any transaction synchronization mechanism, either Spring or JTA.
Furthermore, getCurrentSession() will also seamlessly work with
a request-scoped Session managed by OpenSessionInViewFilter/Interceptor.
Turn this flag off to expose the plain Hibernate SessionFactory with
Hibernate's default getCurrentSession() behavior, where
Hibernate 3.0.x only supports plain JTA synchronization. | public void | setJdbcExceptionTranslator(SQLExceptionTranslator jdbcExceptionTranslator) Set the JDBC exception translator for the SessionFactory,
exposed via the PersistenceExceptionTranslator interface. | public DataAccessException | translateExceptionIfPossible(RuntimeException ex) Implementation of the PersistenceExceptionTranslator interface,
as autodetected by Spring's PersistenceExceptionTranslationPostProcessor. | protected SessionFactory | wrapSessionFactoryIfNecessary(SessionFactory rawSf) Wrap the given SessionFactory with a transaction-aware proxy, if demanded. |
logger | final protected Log logger(Code) | | Logger available to subclasses
|
afterSessionFactoryCreation | protected void afterSessionFactoryCreation() throws Exception(Code) | | Hook that allows post-processing after the SessionFactory has been
successfully created. The SessionFactory is already available through
getSessionFactory() at this point.
This implementation is empty.
See Also: AbstractSessionFactoryBean.getSessionFactory() |
beforeSessionFactoryDestruction | protected void beforeSessionFactoryDestruction()(Code) | | Hook that allows shutdown processing before the SessionFactory
will be closed. The SessionFactory is still available through
getSessionFactory() at this point.
This implementation is empty.
See Also: AbstractSessionFactoryBean.getSessionFactory() |
buildSessionFactory | abstract protected SessionFactory buildSessionFactory() throws Exception(Code) | | Build the underlying Hibernate SessionFactory.
the raw SessionFactory (potentially to be wrapped with atransaction-aware proxy before it is exposed to the application) throws: Exception - in case of initialization failure |
destroy | public void destroy() throws HibernateException(Code) | | Close the SessionFactory on bean factory shutdown.
|
getObject | public Object getObject()(Code) | | Return the singleton SessionFactory.
|
getSessionFactory | final protected SessionFactory getSessionFactory()(Code) | | Return the exposed SessionFactory.
throws: IllegalStateException - if the SessionFactory has not been initialized yet |
getTransactionAwareSessionFactoryProxy | protected SessionFactory getTransactionAwareSessionFactoryProxy(SessionFactory target)(Code) | | Wrap the given SessionFactory with a proxy that delegates every method call
to it but delegates getCurrentSession calls to SessionFactoryUtils,
for participating in Spring-managed transactions.
Parameters: target - the original SessionFactory to wrap the wrapped SessionFactory See Also: org.hibernate.SessionFactory.getCurrentSession See Also: SessionFactoryUtils.doGetSession(org.hibernate.SessionFactoryboolean) |
isExposeTransactionAwareSessionFactory | protected boolean isExposeTransactionAwareSessionFactory()(Code) | | Return whether to expose a transaction-aware proxy for the SessionFactory.
|
isSingleton | public boolean isSingleton()(Code) | | |
setExposeTransactionAwareSessionFactory | public void setExposeTransactionAwareSessionFactory(boolean exposeTransactionAwareSessionFactory)(Code) | | Set whether to expose a transaction-aware proxy for the SessionFactory,
returning the Session that's associated with the current Spring-managed
transaction on getCurrentSession() , if any.
Default is "true", letting data access code work with the plain
Hibernate SessionFactory and its getCurrentSession() method,
while still being able to participate in current Spring-managed transactions:
with any transaction management strategy, either local or JTA / EJB CMT,
and any transaction synchronization mechanism, either Spring or JTA.
Furthermore, getCurrentSession() will also seamlessly work with
a request-scoped Session managed by OpenSessionInViewFilter/Interceptor.
Turn this flag off to expose the plain Hibernate SessionFactory with
Hibernate's default getCurrentSession() behavior, where
Hibernate 3.0.x only supports plain JTA synchronization. On Hibernate 3.1+,
such a plain SessionFactory will by default have a SpringSessionContext
registered to nevertheless provide Spring-managed Sessions; this can be
overridden through the corresponding Hibernate property
"hibernate.current_session_context_class".
See Also: org.hibernate.SessionFactory.getCurrentSession See Also: org.springframework.transaction.jta.JtaTransactionManager See Also: HibernateTransactionManager See Also: org.springframework.orm.hibernate3.support.OpenSessionInViewFilter See Also: org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor See Also: SpringSessionContext |
|
|