org.dbunit.database.search
Class TablesDependencyHelper

java.lang.Object
  extended by org.dbunit.database.search.TablesDependencyHelper

public class TablesDependencyHelper
extends Object

Helper for the graph-search based classes used to calculate dependency among tables.

Since:
Aug 26, 2005
Version:
$Revision: 554 $
Author:
Felipe Leme

Method Summary
static IDataSet getAllDataset(IDatabaseConnection connection, Map rootTables)
           
static IDataSet getAllDataset(IDatabaseConnection connection, String rootTable, Set allowedPKs)
           
static String[] getAllDependentTables(IDatabaseConnection connection, String rootTable)
          Get the name of all tables that depend on a root table ( i.e, all tables whose PK is a FK for the root table) and also the tables the root table depends on (i.e., all tables which have a FK for the root table's PK).
static String[] getAllDependentTables(IDatabaseConnection connection, String[] rootTables)
          Get the name of all tables that depend on the root tables ( i.e, all tables whose PK is a FK for any of the root tables) and also the tables the root tables depends on (i.e., all tables which have a FK for any of the root table's PK).
static IDataSet getDataset(IDatabaseConnection connection, Map rootTables)
           
static IDataSet getDataset(IDatabaseConnection connection, String rootTable, Set allowedIds)
           
static String[] getDependentTables(IDatabaseConnection connection, String rootTable)
          Get the name of all tables that depend on a root table (i.e, all tables whose PK is a FK for the root table).
static String[] getDependentTables(IDatabaseConnection connection, String[] rootTables)
          Get the name of all tables that depend on the root tables (i.e, all tables whose PK is a FK for one of root tables).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDependentTables

public static String[] getDependentTables(IDatabaseConnection connection,
                                          String rootTable)
                                   throws SearchException
Get the name of all tables that depend on a root table (i.e, all tables whose PK is a FK for the root table).

Parameters:
connection - database conncetion
rootTable - root table described above
Returns:
name of all tables that depend on the root table (including the root table), in the right order for insertions
Throws:
SearchException - if an exception occurred while calculating the order

getDependentTables

public static String[] getDependentTables(IDatabaseConnection connection,
                                          String[] rootTables)
                                   throws SearchException
Get the name of all tables that depend on the root tables (i.e, all tables whose PK is a FK for one of root tables).

Parameters:
connection - database conncetion
rootTables - array of root tables described above
Returns:
name of all tables that depend on the root tables (including the root tables), in the right order for insertions
Throws:
SearchException - if an exception occurred while calculating the order

getAllDependentTables

public static String[] getAllDependentTables(IDatabaseConnection connection,
                                             String rootTable)
                                      throws SearchException
Get the name of all tables that depend on a root table ( i.e, all tables whose PK is a FK for the root table) and also the tables the root table depends on (i.e., all tables which have a FK for the root table's PK).

Parameters:
connection - database conncetion
rootTable - root table described above
Returns:
name of all tables that depend on the root table (including the root table), in the right order for insertions
Throws:
SearchException - if an exception occurred while calculating the order

getAllDependentTables

public static String[] getAllDependentTables(IDatabaseConnection connection,
                                             String[] rootTables)
                                      throws SearchException
Get the name of all tables that depend on the root tables ( i.e, all tables whose PK is a FK for any of the root tables) and also the tables the root tables depends on (i.e., all tables which have a FK for any of the root table's PK).

Parameters:
connection - database conncetion
rootTables - root tables described above
Returns:
name of all tables that depend on the root tables (including the root tables), in the right order for insertions
Throws:
SearchException - if an exception occurred while calculating the order

getDataset

public static IDataSet getDataset(IDatabaseConnection connection,
                                  String rootTable,
                                  Set allowedIds)
                           throws SearchException,
                                  SQLException
Throws:
SearchException
SQLException

getDataset

public static IDataSet getDataset(IDatabaseConnection connection,
                                  Map rootTables)
                           throws SearchException,
                                  SQLException
Throws:
SearchException
SQLException

getAllDataset

public static IDataSet getAllDataset(IDatabaseConnection connection,
                                     String rootTable,
                                     Set allowedPKs)
                              throws SearchException,
                                     SQLException
Throws:
SearchException
SQLException

getAllDataset

public static IDataSet getAllDataset(IDatabaseConnection connection,
                                     Map rootTables)
                              throws SearchException,
                                     SQLException
Throws:
SearchException
SQLException


Copyright © 2002-2011. All Rights Reserved.