org.dbunit.database.search
Class TablesDependencyHelper

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

public class TablesDependencyHelper
extends java.lang.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, java.util.Map rootTables)
           
static IDataSet getAllDataset(IDatabaseConnection connection, java.lang.String rootTable, java.util.Set allowedPKs)
           
static java.lang.String[] getAllDependentTables(IDatabaseConnection connection, java.lang.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 java.lang.String[] getAllDependentTables(IDatabaseConnection connection, java.lang.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, java.util.Map rootTables)
           
static IDataSet getDataset(IDatabaseConnection connection, java.lang.String rootTable, java.util.Set allowedIds)
           
static java.lang.String[] getDependentTables(IDatabaseConnection connection, java.lang.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 java.lang.String[] getDependentTables(IDatabaseConnection connection, java.lang.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 java.lang.String[] getDependentTables(IDatabaseConnection connection,
                                                    java.lang.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 java.lang.String[] getDependentTables(IDatabaseConnection connection,
                                                    java.lang.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 java.lang.String[] getAllDependentTables(IDatabaseConnection connection,
                                                       java.lang.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 java.lang.String[] getAllDependentTables(IDatabaseConnection connection,
                                                       java.lang.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,
                                  java.lang.String rootTable,
                                  java.util.Set allowedIds)
                           throws SearchException,
                                  java.sql.SQLException
Throws:
SearchException
java.sql.SQLException

getDataset

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

getAllDataset

public static IDataSet getAllDataset(IDatabaseConnection connection,
                                     java.lang.String rootTable,
                                     java.util.Set allowedPKs)
                              throws SearchException,
                                     java.sql.SQLException
Throws:
SearchException
java.sql.SQLException

getAllDataset

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