Package ubic.gemma.persistence.hibernate
Class LocalSessionFactoryBean
- java.lang.Object
-
- ubic.gemma.persistence.hibernate.LocalSessionFactoryBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<SessionFactory>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ResourceLoaderAware
public class LocalSessionFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<SessionFactory>, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Reimplementation ofLocalSessionFactoryBean
that supports resolving XSD schemas in the classpath.It's been slimmed down to what we actually use in Gemma.
- See Also:
XSDEntityResolver
,LocalSessionFactoryBean
-
-
Constructor Summary
Constructors Constructor Description LocalSessionFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected SessionFactory
buildSessionFactory(org.springframework.orm.hibernate4.LocalSessionFactoryBuilder sfb)
void
destroy()
Configuration
getConfiguration()
Properties
getHibernateProperties()
Return the Hibernate properties, if any.SessionFactory
getObject()
Class<?>
getObjectType()
boolean
isSingleton()
void
setAnnotatedClasses(Class<?>... annotatedClasses)
void
setConfigLocation(org.springframework.core.io.Resource configLocation)
void
setDataSource(DataSource dataSource)
void
setHibernateProperties(Properties hibernateProperties)
void
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
-
-
-
Method Detail
-
setDataSource
public void setDataSource(DataSource dataSource)
-
setConfigLocation
public void setConfigLocation(org.springframework.core.io.Resource configLocation)
-
setHibernateProperties
public void setHibernateProperties(Properties hibernateProperties)
-
getHibernateProperties
public Properties getHibernateProperties()
Return the Hibernate properties, if any. Mainly available for configuration through property paths that specify individual keys.
-
setAnnotatedClasses
public void setAnnotatedClasses(Class<?>... annotatedClasses)
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
afterPropertiesSet
public void afterPropertiesSet() throws IOException
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
IOException
-
buildSessionFactory
protected SessionFactory buildSessionFactory(org.springframework.orm.hibernate4.LocalSessionFactoryBuilder sfb)
-
getConfiguration
public final Configuration getConfiguration()
-
getObject
public SessionFactory getObject()
- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<SessionFactory>
-
getObjectType
public Class<?> getObjectType()
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<SessionFactory>
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<SessionFactory>
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
-