Package org.openbravo.dal.core
Class DalLayerInitializer
- java.lang.Object
-
- org.openbravo.dal.core.DalLayerInitializer
-
- All Implemented Interfaces:
OBProvidable
,OBSingleton
public class DalLayerInitializer extends Object implements OBSingleton
This class is responsible for initializing the DAL layer. It ensures that the model is read in memory and that the mapping is generated in a two stage process.- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description DalLayerInitializer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DalLayerInitializer
getInstance()
void
initialize(boolean rereadConfigFiles)
Initializes the in-memory model, registers the entity classes with theOBProvider
, initializes the SessionFactory and reads the service config files.boolean
isInitialized()
void
setInitialized(boolean initialized)
Can be used to set the internal initialized member to false and then call initialize again to re-initialize the DAL layer.void
setSQLFunctions(Map<String,org.hibernate.dialect.function.SQLFunction> sqlFunctions)
Can be used to manually provide to theDalSessionFactoryController
the SQL functions to be registered in Hibernate.
-
-
-
Method Detail
-
getInstance
public static DalLayerInitializer getInstance()
-
initialize
public void initialize(boolean rereadConfigFiles)
Initializes the in-memory model, registers the entity classes with theOBProvider
, initializes the SessionFactory and reads the service config files.- Parameters:
rereadConfigFiles
- there are cases where it does not make sense to reread the config files with services, for example after installing a module. The system needs to be restarted for those cases.
-
setSQLFunctions
public void setSQLFunctions(Map<String,org.hibernate.dialect.function.SQLFunction> sqlFunctions)
Can be used to manually provide to theDalSessionFactoryController
the SQL functions to be registered in Hibernate.- Parameters:
sqlFunctions
- a Map with the SQL functions to be registered in Hibernate.
-
isInitialized
public boolean isInitialized()
-
setInitialized
public void setInitialized(boolean initialized)
Can be used to set the internal initialized member to false and then call initialize again to re-initialize the DAL layer.- Parameters:
initialized
- the value of the initialized member
-
-