Class Configuration


  • public class Configuration
    extends java.lang.Object
    Configuration - It allows declarative configuration through the hibernate.properties file or the hibernate-types.properties file. The properties from hibernate-types.properties can override the ones from the hibernate.properties file. It loads the Properties configuration file and makes them available to other components.
    Since:
    2.1.0
    • Field Detail

      • PROPERTIES_FILE_PATH

        public static final java.lang.String PROPERTIES_FILE_PATH
        See Also:
        Constant Field Values
      • PROPERTIES_FILE_NAME

        public static final java.lang.String PROPERTIES_FILE_NAME
        See Also:
        Constant Field Values
      • APPLICATION_PROPERTIES_FILE_NAME

        public static final java.lang.String APPLICATION_PROPERTIES_FILE_NAME
        See Also:
        Constant Field Values
      • properties

        private final java.util.Properties properties
      • bannerPrinted

        private static boolean bannerPrinted
    • Constructor Detail

      • Configuration

        private Configuration()
    • Method Detail

      • load

        private void load()
        Load Properties from the resolved InputStream
      • propertiesInputStream

        private java.io.InputStream propertiesInputStream​(java.lang.String propertiesFilePath)
                                                   throws java.io.IOException
        Get Properties file InputStream
        Parameters:
        propertiesFilePath - properties file path
        Returns:
        Properties file InputStream
        Throws:
        java.io.IOException - the file couldn't be loaded properly
      • getProperties

        public java.util.Properties getProperties()
        Get all properties.
        Returns:
        properties.
      • integerProperty

        public java.lang.Integer integerProperty​(Configuration.PropertyKey propertyKey)
        Get Integer property value
        Parameters:
        propertyKey - property key
        Returns:
        Integer property value
      • longProperty

        public java.lang.Long longProperty​(Configuration.PropertyKey propertyKey)
        Get Long property value
        Parameters:
        propertyKey - property key
        Returns:
        Long property value
      • booleanProperty

        public java.lang.Boolean booleanProperty​(Configuration.PropertyKey propertyKey)
        Get Boolean property value
        Parameters:
        propertyKey - property key
        Returns:
        Boolean property value
      • classProperty

        public <T> java.lang.Class<T> classProperty​(Configuration.PropertyKey propertyKey)
        Get Class property value
        Type Parameters:
        T - class generic type
        Parameters:
        propertyKey - property key
        Returns:
        Class property value
      • instantiateClass

        private <T> T instantiateClass​(Configuration.PropertyKey propertyKey)
        Instantiate class associated to the given property key
        Type Parameters:
        T - class parameter type
        Parameters:
        propertyKey - property key
        Returns:
        class instance
      • printBanner

        private void printBanner()
        Print the banner into the log.
      • isHypersistenceOptimizer

        private boolean isHypersistenceOptimizer()