Package org.dbunit.database
Class QueryDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.database.QueryDataSet
- All Implemented Interfaces:
IDataSet
Holds collection of tables resulting from database query.
- Since:
- Dec 4, 2002
- Version:
- $Revision$ $Date$
- Author:
- Eric Pugh, gommma, Last changed by: $Author$
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionQueryDataSet(IDatabaseConnection connection) Create a QueryDataSet by passing in the connection to the database to use.QueryDataSet(IDatabaseConnection connection, boolean caseSensitiveTableNames) Create a QueryDataSet by passing in the connection to the database to use. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a table with using 'SELECT * FROMtableName' as query.voidAdds a table and it's associated query to this dataset.protected ITableIteratorcreateIterator(boolean reversed) Creates an iterator which provides access to all tables of this datasetString[]Returns names of tables in this dataset in proper sequence.Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTables, initialize, isCaseSensitiveTableNames, iterator, reverseIterator, toString
-
Constructor Details
-
QueryDataSet
Create a QueryDataSet by passing in the connection to the database to use.- Parameters:
connection- The connection object to the database.
-
QueryDataSet
Create a QueryDataSet by passing in the connection to the database to use.- Parameters:
connection- The connection object to the database.caseSensitiveTableNames- Whether or not this dataset should use case sensitive table names- Since:
- 2.4.2
-
-
Method Details
-
addTable
Adds a table and it's associated query to this dataset.- Parameters:
tableName- The name of the tablequery- The query to retrieve data with for this table. Can be null which will select all data (seeaddTable(String)for details)- Throws:
AmbiguousTableNameException
-
addTable
Adds a table with using 'SELECT * FROMtableName' as query.- Parameters:
tableName- The name of the table- Throws:
AmbiguousTableNameException
-
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
-
getTableNames
Description copied from interface:IDataSetReturns names of tables in this dataset in proper sequence. Multiple occurrence of the same name may be returned if multiple tables having the same name are present in the dataset.- Specified by:
getTableNamesin interfaceIDataSet- Overrides:
getTableNamesin classAbstractDataSet- Throws:
DataSetException
-