Package org.dbunit.dataset
Class DefaultDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.DefaultDataSet
- All Implemented Interfaces:
IDataSet
Simple implementation of a dataset backed by
ITable objects which can
be added dynamically.- Since:
- 1.0 (Feb 18, 2002)
- Version:
- $Revision$ $Date$
- Author:
- Manuel Laflamme, Last changed by: $Author$
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DefaultDataSet(boolean caseSensitiveTableNames) Creates a default dataset which is empty initiallyDefaultDataSet(ITable table) Creates a default dataset consisting of the given table.DefaultDataSet(ITable[] tables) Creates a default dataset consisting of the given tables.DefaultDataSet(ITable[] tables, boolean caseSensitiveTableNames) Creates a default dataset which consists of the given tablesDefaultDataSet(ITable table1, ITable table2) Creates a default dataset consisting of the given tables. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new table in this dataset.protected ITableIteratorcreateIterator(boolean reversed) Creates an iterator which provides access to all tables of this datasetprotected voidInitializes theAbstractDataSet._orderedTableNameMapof the parent class if it is not initialized yet.Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, iterator, reverseIterator, toString
-
Constructor Details
-
DefaultDataSet
public DefaultDataSet()Default constructor. -
DefaultDataSet
public DefaultDataSet(boolean caseSensitiveTableNames) Creates a default dataset which is empty initially- Parameters:
caseSensitiveTableNames- Whether or not table names should be case sensitive- Since:
- 2.4.2
-
DefaultDataSet
Creates a default dataset consisting of the given table.- Parameters:
table- the table to add.- Throws:
AmbiguousTableNameException- never thrown for a single table.
-
DefaultDataSet
Creates a default dataset consisting of the given tables.- Parameters:
table1- the first table to add.table2- the second table to add.- Throws:
AmbiguousTableNameException- if the two tables have the same name.
-
DefaultDataSet
Creates a default dataset consisting of the given tables.- Parameters:
tables- the tables to add.- Throws:
AmbiguousTableNameException- if two tables have the same name.
-
DefaultDataSet
public DefaultDataSet(ITable[] tables, boolean caseSensitiveTableNames) throws AmbiguousTableNameException Creates a default dataset which consists of the given tables- Parameters:
tables- the tables to add.caseSensitiveTableNames- Whether or not table names should be case sensitive- Throws:
AmbiguousTableNameException- if two tables have the same name.- Since:
- 2.4.2
-
-
Method Details
-
addTable
Add a new table in this dataset.- Parameters:
table- the table to add.- Throws:
AmbiguousTableNameException- if a table with the same name already exists.
-
initialize
protected void initialize()Initializes theAbstractDataSet._orderedTableNameMapof the parent class if it is not initialized yet.- Overrides:
initializein classAbstractDataSet- Since:
- 2.4.6
-
createIterator
Description copied from class:AbstractDataSetCreates an iterator which provides access to all tables of this dataset- Specified by:
createIteratorin classAbstractDataSet- Parameters:
reversed- Whether the created iterator should be a reversed one or not- Returns:
- The created
ITableIterator - Throws:
DataSetException- if the iterator cannot be created.
-