org.unitils.dbunit.datasetloadstrategy.impl
Class RefreshLoadStrategy

java.lang.Object
  extended by org.unitils.dbunit.datasetloadstrategy.impl.BaseDataSetLoadStrategy
      extended by org.unitils.dbunit.datasetloadstrategy.impl.RefreshLoadStrategy
All Implemented Interfaces:
DataSetLoadStrategy

public class RefreshLoadStrategy
extends BaseDataSetLoadStrategy

DataSetLoadStrategy that 'refreshes' the contents of the database with the contents of the dataset. This means that data of existing rows is updated and non-existing rows are inserted. Any rows that are in the database but not in the dataset stay unaffected.

Author:
Filip Neven, Tim Ducheyne
See Also:
DatabaseOperation.REFRESH

Constructor Summary
RefreshLoadStrategy()
           
 
Method Summary
 void doExecute(DbUnitDatabaseConnection dbUnitDatabaseConnection, org.dbunit.dataset.IDataSet dataSet)
          Executes this DataSetLoadStrategy.
 
Methods inherited from class org.unitils.dbunit.datasetloadstrategy.impl.BaseDataSetLoadStrategy
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefreshLoadStrategy

public RefreshLoadStrategy()
Method Detail

doExecute

public void doExecute(DbUnitDatabaseConnection dbUnitDatabaseConnection,
                      org.dbunit.dataset.IDataSet dataSet)
               throws org.dbunit.DatabaseUnitException,
                      SQLException
Executes this DataSetLoadStrategy. This means the given dataset is inserted in the database using the given dbUnit database connection object.

Specified by:
doExecute in class BaseDataSetLoadStrategy
Parameters:
dbUnitDatabaseConnection - DbUnit class providing access to the database
dataSet - The dbunit dataset
Throws:
org.dbunit.DatabaseUnitException - Exception thown by dbunit
SQLException - Exception thown by dbunit


Copyright © 2011. All Rights Reserved.