Package org.dbunit.operation

Examples of org.dbunit.operation.TransactionOperation


      final DataSeedStrategy dataSeedStrategy = dbUnitConfiguration.getDataSeedStrategy();
      final boolean useIdentityInsert = dbUnitConfiguration.isUseIdentityInsert();
      final DatabaseConnection connection = databaseConnection.get();
      final IDataSet initialDataSet = DataSetUtils.mergeDataSets(dataSetRegister.get().getInitial());

      new TransactionOperation(dataSeedStrategy.get(useIdentityInsert)).execute(connection, initialDataSet);
   }
View Full Code Here


   public void cleanupDatabase()
   {
      try
      {
         final IDataSet dataSet = DataSetUtils.mergeDataSets(dataSetRegister.getInitial());
         new TransactionOperation(DatabaseOperation.DELETE_ALL).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

   public void cleanupDatabase()
   {
      try
      {
         final IDataSet dataSet = connection.createDataSet();
         new TransactionOperation(DatabaseOperation.DELETE_ALL).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

   public void cleanupDatabase()
   {
      try
      {
         final IDataSet dataSet = DataSetUtils.mergeDataSets(dataSetRegister.getInitial());
         new TransactionOperation(DatabaseOperation.DELETE).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

   {
      try
      {
         final IDataSet mergeDataSets = DataSetUtils.mergeDataSets(dataSetRegister.getInitial());
         final IDataSet dataSet = DataSetUtils.excludeTables(mergeDataSets, tablesToExclude);
         new TransactionOperation(DatabaseOperation.DELETE_ALL).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

   public void cleanupDatabase(String ... tablesToExclude)
   {
      try
      {
         final IDataSet dataSet = DataSetUtils.excludeTables(connection.createDataSet(), tablesToExclude);
         new TransactionOperation(DatabaseOperation.DELETE_ALL).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

   private void fillDatabase() throws Exception
   {
      final IDataSet initialDataSet = DataSetUtils.mergeDataSets(dataSetRegister.get().getInitial());
      final DatabaseOperation selectedSeedingStrategy = getSelectedSeedingStrategy();
      new TransactionOperation(selectedSeedingStrategy).execute(databaseConnection.get(), initialDataSet);
   }
View Full Code Here

   {
      try
      {
         final IDataSet mergeDataSets = DataSetUtils.mergeDataSets(dataSetRegister.getInitial());
         final IDataSet dataSet = DataSetUtils.excludeTables(mergeDataSets, tablesToExclude);
         new TransactionOperation(DatabaseOperation.DELETE).execute(connection, dataSet);
      }
      catch (Exception e)
      {
         throw new DBUnitDataSetHandlingException("Unable to clean database.", e);
      }
View Full Code Here

        {
            return;
        }

        try {
            DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation);
            // TODO This is not very nice and the design should be reviewed but it works for now (gommma)
            boolean useForwardOnly = _forwardOperation && ! isOrdered();
            IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), useForwardOnly);
            if (_nullToken != null) {
                dataset = new ReplacementDataSet(dataset);
View Full Code Here

            return;
        }

        try
        {
              DatabaseOperation operation = (_transaction ? new TransactionOperation(_operation) : _operation);
            IDataSet dataset = getSrcDataSet(getSrc(), getFormat(), _forwardOperation);
            operation.execute(connection, dataset);
        }
        catch (SQLException e)
        {
View Full Code Here

TOP

Related Classes of org.dbunit.operation.TransactionOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.