org.sqlproc.engine.util
Class DDLLoader

java.lang.Object
  extended by 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 Summary
private  List<String> ddls
          DDL statements from the file.
protected  org.slf4j.Logger logger
          The internal slf4j logger.
 
Constructor Summary
DDLLoader(List<String> fileNames, Class<?> loaderClass)
          Reads the DDL files and creates a new DDLLoader instance.
DDLLoader(String fileName, Class<?> loaderClass)
          Reads the DDL file and creates a new DDLLoader instance.
 
Method Summary
 List<String> getDdls()
           
static List<String> getDDLs(Class<?> loaderClass, String... fileNames)
          Reads the DDL files and parse DDL statements into a list.
static List<String> getDDLs(Class<?> loaderClass, String fileName)
          Reads the DDL file and creates a new DDLLoader instance.
private  List<String> load(String fileName, Class<?> loaderClass)
          Reads the DDL file and parse DDL statements into a list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getDdls

public List<String> getDdls()


Copyright © 2014. All rights reserved.