Package org.dbunit.util.search

Examples of org.dbunit.util.search.DepthFirstSearch


    throws SearchException
    {
        logger.debug("getDependentTables(connection={}, rootTables={}) - start", connection, rootTables);

        ImportedKeysSearchCallback callback = new ImportedKeysSearchCallback(connection);
        DepthFirstSearch search = new DepthFirstSearch();
        Set tables = search.search( rootTables, callback );
        return CollectionsHelper.setToStrings( tables );
    }
View Full Code Here


    throws SearchException
    {
        logger.debug("getDependsOnTables(connection={}, rootTable={}) - start", connection, rootTable);

        ExportedKeysSearchCallback callback = new ExportedKeysSearchCallback(connection);
        DepthFirstSearch search = new DepthFirstSearch();
        Set tables = search.search( new String[]{rootTable}, callback );
        return CollectionsHelper.setToStrings( tables );
    }
View Full Code Here

    throws SearchException
    {
        logger.debug("getAllDependentTables(connection={}, rootTables={}) - start",connection, rootTables);

        ImportedAndExportedKeysSearchCallback callback = new ImportedAndExportedKeysSearchCallback(connection);
        DepthFirstSearch search = new DepthFirstSearch();
        Set tables = search.search(rootTables, callback);
        return CollectionsHelper.setToStrings(tables);
    }
View Full Code Here

    {
        logger.debug("getDataset(connection={}, rootTables={}) - start", connection, rootTables);

        ImportedKeysSearchCallbackFilteredByPKs callback = new ImportedKeysSearchCallbackFilteredByPKs(connection, rootTables);
        ITableFilter filter = callback.getFilter();
        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

    {
        logger.debug("getAllDataset(connection={}, rootTables={}) - start", connection, rootTables);

        ImportedAndExportedKeysSearchCallbackFilteredByPKs callback = new ImportedAndExportedKeysSearchCallbackFilteredByPKs(connection, rootTables);   
        ITableFilter filter = callback.getFilter();
        DepthFirstSearch search = new DepthFirstSearch();
        String[] tableNames = rootTables.getTableNames();
        Set 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

        logger.debug("getDirectDependsOnTables(connection={}, tableName={}) - start",
                    connection, tableName);
       
        ExportedKeysSearchCallback callback = new ExportedKeysSearchCallback(connection);
        // Do a depthFirstSearch with a recursion depth of 1
        DepthFirstSearch search = new DepthFirstSearch(1);
        Set tables = search.search( new String[]{tableName}, callback );
        return tables;
    }
View Full Code Here

        logger.debug("getDirectDependentTables(connection={}, tableName={}) - start",
                    connection, tableName);

        ImportedKeysSearchCallback callback = new ImportedKeysSearchCallback(connection);
        // Do a depthFirstSearch with a recursion depth of 1
        DepthFirstSearch search = new DepthFirstSearch(1);
        Set tables = search.search( new String[]{tableName}, callback );
        return tables;
    }
View Full Code Here

   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getDependentTables( IDatabaseConnection connection, String[] rootTables ) throws SearchException {
    ImportedKeysSearchCallback callback = new ImportedKeysSearchCallback(connection);
    DepthFirstSearch search = new DepthFirstSearch();
    Set tables = search.search( rootTables, callback );
    return (String[]) CollectionsHelper.setToStrings( tables );
  }
View Full Code Here

   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getAllDependentTables( IDatabaseConnection connection, String[] rootTables ) throws SearchException {
    ImportedAndExportedKeysSearchCallback callback = new ImportedAndExportedKeysSearchCallback(connection);
    DepthFirstSearch search = new DepthFirstSearch();
    Set tables = search.search( rootTables, callback );
    return (String[]) CollectionsHelper.setToStrings( tables );
  }
View Full Code Here

  }
 
  public static IDataSet getDataset( IDatabaseConnection connection, Map rootTables ) throws SearchException, SQLException {
    ImportedKeysSearchCallbackFilteredByPKs callback = new ImportedKeysSearchCallbackFilteredByPKs(connection, rootTables);
    ITableFilter filter = callback.getFilter();
    DepthFirstSearch search = new DepthFirstSearch();
    String[] tableNames = CollectionsHelper.setToStrings( rootTables.keySet() );
    Set 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

Related Classes of org.dbunit.util.search.DepthFirstSearch

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.