| java.lang.Object org.springframework.orm.toplink.LocalSessionFactory org.springframework.orm.toplink.LocalSessionFactoryBean
LocalSessionFactoryBean | public class LocalSessionFactoryBean extends LocalSessionFactory implements FactoryBean,BeanClassLoaderAware,InitializingBean,DisposableBean,PersistenceExceptionTranslator(Code) | | org.springframework.beans.factory.FactoryBean that creates a
TopLink
SessionFactory . This is the usual way to set up a shared
TopLink SessionFactory in a Spring application context; the SessionFactory
can then be passed to TopLink-based DAOs via dependency injection.
See the base class
LocalSessionFactory for configuration details.
This class also implements the
org.springframework.dao.support.PersistenceExceptionTranslator interface, as autodetected by Spring's
org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor ,
for AOP-based translation of native exceptions to Spring DataAccessExceptions.
Hence, the presence of a LocalSessionFactoryBean automatically enables a
PersistenceExceptionTranslationPostProcessor to translate TopLink exceptions.
If your DAOs expect to receive a raw TopLink Session, consider defining a
org.springframework.orm.toplink.support.TransactionAwareSessionAdapter in front of this bean. This adapter will provide a TopLink Session rather
than a SessionFactory as bean reference. Your DAOs can then, for example,
access the currently active Session and UnitOfWork via
Session.getActiveSession() and Session.getActiveUnitOfWork() ,
respectively. Note that you can still access the SessionFactory as well, by
defining a bean reference that points directly at the LocalSessionFactoryBean.
author: Juergen Hoeller since: 1.2 See Also: LocalSessionFactory See Also: org.springframework.orm.toplink.support.TransactionAwareSessionAdapter See Also: org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor |
afterPropertiesSet | public void afterPropertiesSet() throws TopLinkException(Code) | | |
destroy | public void destroy()(Code) | | |
getJdbcExceptionTranslator | public SQLExceptionTranslator getJdbcExceptionTranslator()(Code) | | Return the JDBC exception translator for this instance, if any.
|
isSingleton | public boolean isSingleton()(Code) | | |
|
|