org.dbunit.database
Class DatabaseDataSet

java.lang.Object
  extended by org.dbunit.dataset.AbstractDataSet
      extended by org.dbunit.database.DatabaseDataSet
All Implemented Interfaces:
IDataSet

public class DatabaseDataSet
extends AbstractDataSet

Provides access to a database instance as a IDataSet.

Since:
1.0 (Feb 17, 2002)
Version:
$Revision: 1189 $ $Date: 2010-06-05 17:49:22 -0500 (Sat, 05 Jun 2010) $
Author:
Manuel Laflamme, Last changed by: $Author: jeffjensen $

Field Summary
 
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap
 
Constructor Summary
DatabaseDataSet(IDatabaseConnection connection, boolean caseSensitiveTableNames)
          Creates a new database data set
DatabaseDataSet(IDatabaseConnection connection, boolean caseSensitiveTableNames, ITableFilterSimple tableFilter)
          Creates a new database data set
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
          Creates an iterator which provides access to all tables of this dataset
 ITable getTable(String tableName)
          Returns the specified table.
 ITableMetaData getTableMetaData(String tableName)
          Returns the specified table metadata.
 String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTables, isCaseSensitiveTableNames, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseDataSet

public DatabaseDataSet(IDatabaseConnection connection,
                       boolean caseSensitiveTableNames)
                throws SQLException
Creates a new database data set

Parameters:
connection - The database connection
caseSensitiveTableNames - Whether or not this dataset should use case sensitive table names
Throws:
SQLException
Since:
2.4

DatabaseDataSet

public DatabaseDataSet(IDatabaseConnection connection,
                       boolean caseSensitiveTableNames,
                       ITableFilterSimple tableFilter)
                throws SQLException
Creates a new database data set

Parameters:
connection - The database connection
caseSensitiveTableNames - Whether or not this dataset should use case sensitive table names
tableFilter - Table filter to specify tables to be omitted in this dataset. Can be null.
Throws:
SQLException
Since:
2.4.3
Method Detail

createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Description copied from class: AbstractDataSet
Creates an iterator which provides access to all tables of this dataset

Specified by:
createIterator in class AbstractDataSet
Parameters:
reversed - Whether the created iterator should be a reversed one or not
Returns:
The created ITableIterator
Throws:
DataSetException

getTableNames

public String[] getTableNames()
                       throws DataSetException
Description copied from interface: IDataSet
Returns 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:
getTableNames in interface IDataSet
Overrides:
getTableNames in class AbstractDataSet
Throws:
DataSetException

getTableMetaData

public ITableMetaData getTableMetaData(String tableName)
                                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table metadata.

Specified by:
getTableMetaData in interface IDataSet
Overrides:
getTableMetaData in class AbstractDataSet
Throws:
NoSuchTableException - if dataset do not contains the specified table
DataSetException

getTable

public ITable getTable(String tableName)
                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table.

Specified by:
getTable in interface IDataSet
Overrides:
getTable in class AbstractDataSet
Throws:
NoSuchTableException - if dataset do not contains the specified table
DataSetException


Copyright © 2002-2012. All Rights Reserved.