org.makumba
Class HibernateSFManager

java.lang.Object
  extended by 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:

Other Hibernate settings are available at:
Additionaly, it is possible to:

Version:
$Id: HibernateSFManager.java 5151 2010-05-18 19:07:27Z rosso_nero $
Author:
Manuel Gay, Rudolf Mayer, Cristian Bogdan

Field Summary
static String HIBERNATE_CURRENT_SESSION_CONTEXT
           
static String HIBERNATE_TRANSACTION_FACTORY
           
static int sessionFactories
           
 
Constructor Summary
HibernateSFManager()
           
 
Method Summary
static String findClassesRootFolder(String locatorSeed)
           
static org.hibernate.cfg.Configuration getConfiguration(String cfgFilePath)
           
static org.hibernate.cfg.Configuration getConfiguredConfiguration()
          Gets the Hibernate Configuration that was used to create the SessionFactory
static String getFullyQualifiedName(String className)
           
static Vector<String> getGeneratedClasses()
           
static org.hibernate.SessionFactory getSF()
           
static org.hibernate.SessionFactory getSF(String dataSource)
           
static void setExternalConfigurationResources(Vector<String> resources)
          Sets additional resources to be included in the Configuration and used at SessionFactory creation time.
static void setExternalMappingClasses(HashMap<String,Vector<Class>> mappingClasses)
          Sets additional mapping classes (i.e. annotated classes) to be used by the Configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

HibernateSFManager

public HibernateSFManager()
Method Detail

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()