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

      • DalLayerInitializer

        public DalLayerInitializer()
    • Method Detail

      • initialize

        public void initialize​(boolean rereadConfigFiles)
        Initializes the in-memory model, registers the entity classes with the OBProvider, 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 the DalSessionFactoryController 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