Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.dbunit.database
Class QueryDataSet  view QueryDataSet download QueryDataSet.java

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.database.QueryDataSet
All Implemented Interfaces:
org.dbunit.dataset.IDataSet

public class QueryDataSet
extends org.dbunit.dataset.AbstractDataSet

Holds collection of tables resulting from database query.

Since:
Dec 4, 2002
Version:
$Revision: 1.8 $

Nested Class Summary
(package private) static class QueryDataSet.TableEntry
           
 
Field Summary
private  IDatabaseConnection _connection
           
private  java.util.List _tableEntries
           
 
Constructor Summary
QueryDataSet(IDatabaseConnection connection)
          Create a QueryDataSet by passing in the connection to the database to use.
 
Method Summary
 void addTable(java.lang.String tableName)
          Adds a table with using 'SELECT * FROM tableName' as query.
 void addTable(java.lang.String tableName, java.lang.String query)
          Adds a table and it's associted query to this dataset.
protected  org.dbunit.dataset.ITableIterator createIterator(boolean reversed)
           
 java.lang.String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTable, getTableMetaData, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_connection

private final IDatabaseConnection _connection

_tableEntries

private final java.util.List _tableEntries
Constructor Detail

QueryDataSet

public QueryDataSet(IDatabaseConnection connection)
             throws java.sql.SQLException
Create a QueryDataSet by passing in the connection to the database to use.

Method Detail

addTable

public void addTable(java.lang.String tableName,
                     java.lang.String query)
Adds a table and it's associted query to this dataset.


addTable

public void addTable(java.lang.String tableName)
Adds a table with using 'SELECT * FROM tableName' as query.


createIterator

protected org.dbunit.dataset.ITableIterator createIterator(boolean reversed)
                                                    throws org.dbunit.dataset.DataSetException

getTableNames

public java.lang.String[] getTableNames()
                                 throws org.dbunit.dataset.DataSetException
Description copied from interface: org.dbunit.dataset.IDataSet
Returns names of tables in this dataset in proper sequence. Multiple occurence of the same name may be returned if multiple tables having the same name are present in the dataset.