类 SessionFactoryBean
java.lang.Object
org.beangle.orm.hibernate.SessionFactoryBean
- 所有已实现的接口:
Disposable,Initializing,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.FactoryBean<org.hibernate.SessionFactory>
public class SessionFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<org.hibernate.SessionFactory>, Initializing, Disposable, org.springframework.beans.factory.BeanClassLoaderAware
- 版本:
- $Id: SessionFactoryBean.java Feb 27, 2012 10:52:27 PM chaostone $
- 作者:
- chaostone
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voiddestroy()org.hibernate.cfg.ConfigurationReturn the Hibernate properties, if any.org.hibernate.SessionFactoryClass<? extends org.hibernate.SessionFactory>org.hibernate.SessionFactoryvoidinit()booleanprotected org.hibernate.cfg.ConfigurationSubclasses can override this method to perform custom initialization of the Configuration instance used for SessionFactory creation.protected voidvoidsetBeanClassLoader(ClassLoader classLoader) voidsetConfigLocations(org.springframework.core.io.Resource[] configLocations) Set the locations of multiple Hibernate XML config files, for example as classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".voidsetConfigurationClass(Class<? extends org.hibernate.cfg.Configuration> configurationClass) voidsetDataSource(DataSource dataSource) voidsetHibernateProperties(Properties hibernateProperties) Set Hibernate properties, such as "hibernate.dialect".voidsetNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy) Set a Hibernate NamingStrategy for the SessionFactory, determining the physical column and table names given the info in the mapping document.voidsetPersistLocations(org.springframework.core.io.Resource[] persistLocations) voidsetStaticHbm(org.springframework.core.io.Resource staticHbm)
-
字段详细资料
-
logger
protected org.slf4j.Logger logger
-
-
构造器详细资料
-
SessionFactoryBean
public SessionFactoryBean()
-
-
方法详细资料
-
setConfigLocations
public void setConfigLocations(org.springframework.core.io.Resource[] configLocations) Set the locations of multiple Hibernate XML config files, for example as classpath resources "classpath:hibernate.cfg.xml,classpath:extension.cfg.xml".Note: Can be omitted when all necessary properties and mapping resources are specified locally via this bean.
- 另请参阅:
-
Configuration.configure(java.net.URL)
-
setPersistLocations
public void setPersistLocations(org.springframework.core.io.Resource[] persistLocations) -
setHibernateProperties
Set Hibernate properties, such as "hibernate.dialect".Can be used to override values in a Hibernate XML config file, or to specify all necessary properties locally.
Note: Do not specify a transaction provider here when using Spring-driven transactions. It is also advisable to omit connection provider settings and use a Spring-set DataSource instead.
-
getHibernateProperties
Return the Hibernate properties, if any. Mainly available for configuration through property paths that specify individual keys. -
setNamingStrategy
public void setNamingStrategy(org.hibernate.cfg.NamingStrategy namingStrategy) Set a Hibernate NamingStrategy for the SessionFactory, determining the physical column and table names given the info in the mapping document.- 另请参阅:
-
Configuration.setNamingStrategy(org.hibernate.cfg.NamingStrategy)
-
processProperties
protected void processProperties() -
init
- 指定者:
init在接口中Initializing- 抛出:
Exception
-
newConfiguration
protected org.hibernate.cfg.Configuration newConfiguration() throws org.hibernate.HibernateExceptionSubclasses can override this method to perform custom initialization of the Configuration instance used for SessionFactory creation. The properties of this LocalSessionFactoryBean will be applied to the Configuration object that gets returned here.The default implementation creates a new Configuration instance. A custom implementation could prepare the instance in a specific way, or use a custom Configuration subclass.
- 返回:
- the Configuration instance
- 抛出:
org.hibernate.HibernateException- in case of Hibernate initialization errors- 另请参阅:
-
Configuration()
-
destroy
public void destroy() throws org.hibernate.HibernateException- 指定者:
destroy在接口中Disposable- 抛出:
org.hibernate.HibernateException
-
setBeanClassLoader
- 指定者:
setBeanClassLoader在接口中org.springframework.beans.factory.BeanClassLoaderAware
-
getObject
public org.hibernate.SessionFactory getObject()- 指定者:
getObject在接口中org.springframework.beans.factory.FactoryBean<org.hibernate.SessionFactory>
-
getObjectType
- 指定者:
getObjectType在接口中org.springframework.beans.factory.FactoryBean<org.hibernate.SessionFactory>
-
isSingleton
public boolean isSingleton()- 指定者:
isSingleton在接口中org.springframework.beans.factory.FactoryBean<org.hibernate.SessionFactory>
-
getDataSource
-
setDataSource
-
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory() -
setConfigurationClass
public void setConfigurationClass(Class<? extends org.hibernate.cfg.Configuration> configurationClass) -
getConfiguration
public org.hibernate.cfg.Configuration getConfiguration() -
setStaticHbm
public void setStaticHbm(org.springframework.core.io.Resource staticHbm)
-