|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbunit.dataset.AbstractDataSet org.dbunit.database.QueryDataSet
public class QueryDataSet
Holds collection of tables resulting from database query.
Field Summary |
---|
Fields inherited from class org.dbunit.dataset.AbstractDataSet |
---|
_orderedTableNameMap |
Constructor Summary | |
---|---|
QueryDataSet(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 | |
---|---|
void |
addTable(String tableName)
Adds a table with using 'SELECT * FROM tableName ' as query. |
void |
addTable(String tableName,
String query)
Adds a table and it's associated query to this dataset. |
protected ITableIterator |
createIterator(boolean reversed)
Creates an iterator which provides access to all tables of this dataset |
String[] |
getTableNames()
Returns names of tables in this dataset in proper sequence. |
Methods inherited from class org.dbunit.dataset.AbstractDataSet |
---|
createTableNameMap, getTable, getTableMetaData, getTables, isCaseSensitiveTableNames, iterator, reverseIterator, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryDataSet(IDatabaseConnection connection)
connection
- The connection object to the database.public QueryDataSet(IDatabaseConnection connection, boolean caseSensitiveTableNames)
connection
- The connection object to the database.caseSensitiveTableNames
- Whether or not this dataset should use case sensitive table namesMethod Detail |
---|
public void addTable(String tableName, String query) throws AmbiguousTableNameException
tableName
- The name of the tablequery
- The query to retrieve data with for this table. Can be null which will select
all data (see addTable(String)
for details)
AmbiguousTableNameException
public void addTable(String tableName) throws AmbiguousTableNameException
tableName
' as query.
tableName
- The name of the table
AmbiguousTableNameException
protected ITableIterator createIterator(boolean reversed) throws DataSetException
AbstractDataSet
createIterator
in class AbstractDataSet
reversed
- Whether the created iterator should be a reversed one or not
ITableIterator
DataSetException
public String[] getTableNames() throws DataSetException
IDataSet
getTableNames
in interface IDataSet
getTableNames
in class AbstractDataSet
DataSetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |