Class DDLLoader

java.lang.Object
org.sqlproc.engine.util.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 Details

    • logger

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

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

    • 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 Details

    • getDDLs

      public static List<String> getDDLs(Class<?> loaderClass, String fileName)
      Reads the DDL file and creates a new DDLLoader instance.
      Parameters:
      loaderClass - Class used to detect the correct classloader.
      fileName - The name of the file to be read.
      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:
      loaderClass - Class used to detect the correct classloader.
      fileNames - The names of the files to be read.
      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
    • getDdls

      public List<String> getDdls()