org.makumba
Class HibernateSFManager
java.lang.Object
org.makumba.HibernateSFManager
public class HibernateSFManager
- extends Object
Hibernate Session Factory Manager: handles the configuration and generation of the Hibernate sessionFactory used by
Makumba.
Additional settings can be provided in the configuration file (databaseName.cfg.xml), such as:
- makumba.seed: the name of the seed file, used to locate the root folder of where makumba should place the
generated mappings and classes
- prefix: the prefix of all the makumba generated mappings (i.e. the name of the folder where they will be stored,
also used as package name)
- makumba.mdd.root: the name of the folder in which the MDDs of the webapp are located. If none is provided, the
default value is "dataDefinitions".
- makumba.mdd.list: a comma-separated list of MDDs that should be used. If none is provided, makumba will use all
the MDDs in the root folder, if there are.
- makumba.mdd.additionalList: a comma-separated list of MDDs that should be used in addition to all MDDs found in
the root folder. if none is provided, makumba will use all the MDDs in the root folder, if there are.
- schemaUpdate: indicates whether makumba should do a schema update with the session factory.
Other Hibernate settings are available at:
- http://www.hibernate.org/hib_docs/reference/en/html/configuration-hibernatejdbc.html
- http://www.hibernate.org/hib_docs/reference/en/html/configuration-optional.html
Additionaly, it is possible to:
- Add external mapping resources by providing a Vector containing the relative path to those resources (as one
would do with Hibernate's Configuration.addResource()) using the setExternalConfigurationResources() method
- Tell Makumba to use an already existing session factory using the setHibernateSessionFactory() method
- Version:
- $Id: HibernateSFManager.java 5151 2010-05-18 19:07:27Z rosso_nero $
- Author:
- Manuel Gay, Rudolf Mayer, Cristian Bogdan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HIBERNATE_TRANSACTION_FACTORY
public static final String HIBERNATE_TRANSACTION_FACTORY
- See Also:
- Constant Field Values
HIBERNATE_CURRENT_SESSION_CONTEXT
public static final String HIBERNATE_CURRENT_SESSION_CONTEXT
- See Also:
- Constant Field Values
sessionFactories
public static int sessionFactories
HibernateSFManager
public HibernateSFManager()
findClassesRootFolder
public static String findClassesRootFolder(String locatorSeed)
getSF
public static org.hibernate.SessionFactory getSF(String dataSource)
getSF
public static org.hibernate.SessionFactory getSF()
getConfiguration
public static org.hibernate.cfg.Configuration getConfiguration(String cfgFilePath)
getConfiguredConfiguration
public static org.hibernate.cfg.Configuration getConfiguredConfiguration()
- Gets the Hibernate
Configuration
that was used to create the SessionFactory
- Returns:
setExternalConfigurationResources
public static void setExternalConfigurationResources(Vector<String> resources)
- Sets additional resources to be included in the Configuration and used at
SessionFactory
creation time.
- Parameters:
resources
- a Vector of String containing the relative path to the additional mapping resources
setExternalMappingClasses
public static void setExternalMappingClasses(HashMap<String,Vector<Class>> mappingClasses)
- Sets additional mapping classes (i.e. annotated classes) to be used by the Configuration
- Parameters:
mappingClasses
- a Map of Vectors, where the keys are package names and the vector elements classes, e.g.
test.animals
Dog.class
Cat.class
getFullyQualifiedName
public static String getFullyQualifiedName(String className)
getGeneratedClasses
public static Vector<String> getGeneratedClasses()