当前页面:
在线文档首页 >
JBoss Seam 1.2.0 API 英文版文档
HibernateFactory (JBoss Seam API Documentation) - JBoss Seam 1.2.0 API 英文版文档
org.jboss.seam.microcontainer
Class HibernateFactory
java.lang.Object
org.jboss.seam.microcontainer.HibernateFactory
- Direct Known Subclasses:
- HibernateSessionFactory
public class HibernateFactory
- extends Object
A factory that bootstraps a Hibernate SessionFactory.
Loads Hibernate configuration options by checking:
hibernate.properties in root of the classpath
hibernate.cfg.xml in root of the classpath
cfgResourceName as location of a cfg.xml file
factory-suplied cfgProperties options
Note that this factory only supports cfg.xml files or programmatic
cfgProperties supplied to the factory. Any
hibernate.properties are always loaded from the classpath.
Mapping metadata can be supplied through:
mappingClasses: equivalent to <mapping class="..."/>
mappingFiles: equivalent to <mapping file="..."/>
mappingJars: equivalent to <mapping jar="..."/>
mappingPackages: equivalent to <mapping package="..."/>
mappingResources: equivalent to <mapping resource="..."/>
or through cfg.xml files.
The jndiProperties are convenience, the factory will automatically
prefix regular JNDI properties for use as Hibernate configuration properties.
- Author:
- Gavin King, Christian Bauer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateFactory
public HibernateFactory()
getSessionFactory
public org.hibernate.SessionFactory getSessionFactory()
throws Exception
- Throws:
Exception
createSessionFactory
protected org.hibernate.SessionFactory createSessionFactory()
throws ClassNotFoundException
- Throws:
ClassNotFoundException
getCfgResourceName
public String getCfgResourceName()
setCfgResourceName
public void setCfgResourceName(String cfgFileName)
getCfgProperties
public Map<String,String> getCfgProperties()
setCfgProperties
public void setCfgProperties(Map<String,String> cfgProperties)
getMappingClasses
public List<String> getMappingClasses()
setMappingClasses
public void setMappingClasses(List<String> mappingClasses)
getMappingFiles
public List<String> getMappingFiles()
setMappingFiles
public void setMappingFiles(List<String> mappingFiles)
getMappingJars
public List<String> getMappingJars()
setMappingJars
public void setMappingJars(List<String> mappingJars)
getMappingPackages
public List<String> getMappingPackages()
setMappingPackages
public void setMappingPackages(List<String> mappingPackages)
getMappingResources
public List<String> getMappingResources()
setMappingResources
public void setMappingResources(List<String> mappingResources)