Class AbstractBatchOperation

Direct Known Subclasses:
DeleteOperation, InsertOperation, UpdateOperation

public abstract class AbstractBatchOperation extends AbstractOperation
Base implementation for database operation that are executed in batch.
Since:
Feb 19, 2002
Version:
$Revision$
Author:
Manuel Laflamme
  • Field Details

    • _reverseRowOrder

      protected boolean _reverseRowOrder
      Whether the tables of the dataset are processed in reverse order, as needed by operations (for example deletes) that must respect foreign-key dependency order in the opposite direction of inserts.
  • Constructor Details

    • AbstractBatchOperation

      protected AbstractBatchOperation()
      Default constructor.
  • Method Details

    • iterator

      protected ITableIterator iterator(IDataSet dataSet) throws DatabaseUnitException
      Returns list of tables this operation is applied to. This method allow subclass to do filtering.
      Parameters:
      dataSet - the dataset whose tables are to be iterated.
      Returns:
      an iterator over the tables this operation applies to.
      Throws:
      DatabaseUnitException - if the iterator cannot be created.
    • execute

      public void execute(IDatabaseConnection connection, IDataSet dataSet) throws DatabaseUnitException, SQLException
      Description copied from class: DatabaseOperation
      Executes this operation on the specified database using the specified dataset contents.
      Specified by:
      execute in class DatabaseOperation
      Parameters:
      connection - the database connection.
      dataSet - the dataset to be used by this operation.
      Throws:
      DatabaseUnitException - if a DbUnit-specific error occurs while executing the operation.
      SQLException - if a database access error occurs while executing the operation.
    • handleColumnHasNoValue

      protected void handleColumnHasNoValue(String tableName, String columnName)
      Reports that a column required to have a value was empty, respecting the DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS setting.
      Parameters:
      tableName - the name of the table containing the column.
      columnName - the name of the column that had no value.
    • toString

      public String toString()
      Overrides:
      toString in class Object