Examples of FilteredDataSet


Examples of org.dbunit.dataset.FilteredDataSet

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

Examples of org.dbunit.dataset.FilteredDataSet

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

Examples of org.dbunit.dataset.FilteredDataSet

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

Examples of org.dbunit.dataset.FilteredDataSet

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

Examples of org.dbunit.dataset.FilteredDataSet

   */
  public void exportData(final String dir, final String fileName) {
    new DbUnitTemplate(dataSource).execute(new DbUnitCallback() {
      @Override
      public void doInDbUnit(IDatabaseConnection connection) throws Exception {
        IDataSet dataSet = new FilteredDataSet(new DatabaseSequenceFilter(connection),
            connection.createDataSet());
        File parent = new File(dir);
        if (!parent.exists()) {
          parent.mkdirs();
        }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

   */
  public void exportDtd(final String dir, final String fileName) {
    new DbUnitTemplate(dataSource).execute(new DbUnitCallback() {
      @Override
      public void doInDbUnit(IDatabaseConnection connection) throws Exception {
        IDataSet dataSet = new FilteredDataSet(new DatabaseSequenceFilter(connection),
            connection.createDataSet());
        File parent = new File(dir);
        if (!parent.exists()) {
          parent.mkdirs();
        }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

      return names;
   }

   public static IDataSet excludeTables(IDataSet dataSet, String ... tablesToExclude)
   {
      return new FilteredDataSet(new ExcludeTableFilter(tablesToExclude), dataSet);
   }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

    public IDataSet createDataSet() throws SQLException
    {
        logger.debug("createDataSet() - start");

        IDataSet dataSet = super.createDataSet();
        return new FilteredDataSet(_filter, dataSet);
    }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

    public IDataSet createDataSet(String[] tableNames) throws SQLException, DataSetException
    {
        logger.debug("createDataSet(tableNames={}) - start", tableNames);

        IDataSet dataSet = super.createDataSet(tableNames);
        return new FilteredDataSet(_filter, dataSet);
    }
View Full Code Here

Examples of org.dbunit.dataset.FilteredDataSet

        DepthFirstSearch search = new DepthFirstSearch();
        String[] tableNames = rootTables.getTableNames();
        ListOrderedSet tmpTables = search.search( tableNames, callback );
        String[] dependentTables  = CollectionsHelper.setToStrings( tmpTables );
        IDataSet tmpDataset = connection.createDataSet( dependentTables );
        FilteredDataSet dataset = new FilteredDataSet(filter, tmpDataset);
        return dataset;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.