Class QueryTableIterator

java.lang.Object
org.dbunit.database.QueryTableIterator
All Implemented Interfaces:
ITableIterator

public class QueryTableIterator extends Object implements ITableIterator
Iterator used to iterate over a list of tables using a specific query for retrieving data for every table.
Since:
1.5.6 (Sep 15, 2003)
Version:
$Revision$ $Date$
Author:
Manuel Laflamme, gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
  • Constructor Details

    • QueryTableIterator

      public QueryTableIterator(List tableEntries, IDatabaseConnection connection)
      Constructs an iterator over the given table entries.
      Parameters:
      tableEntries - list of QueryDataSet.TableEntry objects
      connection - The database connection needed to load data
  • Method Details

    • next

      public boolean next() throws DataSetException
      Position this iterator to the next table. The iterator is initially positioned before the first table; the first call to the method next makes the first table the current table; the second call makes the second table the current table, and so on.
      Specified by:
      next in interface ITableIterator
      Returns:
      true if the new current table is valid; false if there are no more table
      Throws:
      DataSetException - if advancing to the next table fails.
    • nextWithoutClosing

      public boolean nextWithoutClosing()
      Advances to the next table without closing the current one.
      Returns:
      true if there is a next table.
    • getTableMetaData

      public ITableMetaData getTableMetaData() throws DataSetException
      Returns the metadata of the current table.
      Specified by:
      getTableMetaData in interface ITableIterator
      Returns:
      the metadata of the current table.
      Throws:
      DataSetException - if retrieving the metadata fails.
    • getTable

      public ITable getTable() throws DataSetException
      Returns the current table.
      Specified by:
      getTable in interface ITableIterator
      Returns:
      the current table.
      Throws:
      DataSetException - if retrieving the table fails.