Package org.dbunit.dataset.sqlloader
Class SqlLoaderControlDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.CachedDataSet
org.dbunit.dataset.sqlloader.SqlLoaderControlDataSet
- All Implemented Interfaces:
IDataSet,IDataSetConsumer
This class constructs an
The
IDataSet given a directory containing control
files. It handles translations of "null"(the string), into null.
Example usage:
The file
File ctlDir = new File("src/sqlloader");
File orderedTablesFile = new File("src/sqlloader/tables.lst");
IDataSet dataSet = new SqlLoaderControlDataSet(ctlDir, orderedTablesFile);
orderedTablesFile must contain the names of the tables to
be imported. As a convention the .ctl file must have the same name as the table names file.
Here an example of the "tables.lst" file:
| LANGUAGE COUNTRY |
ctlDir directory must then contain the files COUNTRY.ctl
and LANGUAGE.ctl.
- Since:
- 2.4.0
- Version:
- $Revision$ $Date$
- Author:
- Stephan Strittmatter (stritti AT users.sourceforge.net), gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionSqlLoaderControlDataSet(File ctlDir, File orderedTablesFile) The Constructor.SqlLoaderControlDataSet(File ctlDir, List orderedTableNames) The Constructor.SqlLoaderControlDataSet(String ctlDir, String orderedTablesFile) The Constructor. -
Method Summary
Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTableMethods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, initialize, isCaseSensitiveTableNames, iterator, reverseIterator, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.dbunit.dataset.IDataSet
getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, iterator, reverseIterator
-
Constructor Details
-
SqlLoaderControlDataSet
The Constructor.- Parameters:
ctlDir- the control files directoryorderedTablesFile- the table order file- Throws:
DataSetException- the data set exception
-
SqlLoaderControlDataSet
The Constructor.- Parameters:
ctlDir- the control files directoryorderedTablesFile- the table order file- Throws:
DataSetException- the data set exception
-
SqlLoaderControlDataSet
The Constructor.- Parameters:
ctlDir- the control files directoryorderedTableNames- a list of strings that contains the ordered table names- Throws:
DataSetException- the data set exception
-