Class DDLLoader


  • public class DDLLoader
    extends Object
    The helper class for the DDL file(s) loading. This file can be located on the classpath, in the root directory or in the user's home directory. It's used for example to set up database layout before the JUnit tests are processed.

    For more info please see the Tutorials.

    Author:
    Vladimir Hudec
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
        The internal slf4j logger.
      • ddls

        private List<String> ddls
        DDL statements from the file.
    • Constructor Detail

      • DDLLoader

        public DDLLoader​(String fileName,
                         Class<?> loaderClass)
        Reads the DDL file and creates a new DDLLoader instance.
        Parameters:
        fileName - The name of the file to be read.
        loaderClass - Class used to detect the correct classloader.
      • DDLLoader

        public DDLLoader​(List<String> fileNames,
                         Class<?> loaderClass)
        Reads the DDL files and creates a new DDLLoader instance.
        Parameters:
        fileNames - The names of the files to be read.
        loaderClass - Class used to detect the correct classloader.
    • Method Detail

      • getDDLs

        public static List<String> getDDLs​(Class<?> loaderClass,
                                           String fileName)
        Reads the DDL file and creates a new DDLLoader instance.
        Parameters:
        fileName - The name of the file to be read.
        loaderClass - Class used to detect the correct classloader.
        Returns:
        all DDL statements as a list
      • getDDLs

        public static List<String> getDDLs​(Class<?> loaderClass,
                                           String... fileNames)
        Reads the DDL files and parse DDL statements into a list.
        Parameters:
        fileNames - The names of the files to be read.
        loaderClass - Class used to detect the correct classloader.
        Returns:
        all DDL statements as a list
      • load

        private List<String> load​(String fileName,
                                  Class<?> loaderClass)
        Reads the DDL file and parse DDL statements into a list.
        Parameters:
        fileName - The name of the file to be read.
        loaderClass - Class used to detect the correct classloader.
        Returns:
        all DDL statements as a list