| java.lang.Object org.dbunit.util.search.AbstractNodesFilterSearchCallback org.dbunit.database.search.AbstractMetaDataBasedSearchCallback
All known Subclasses: org.dbunit.database.search.ImportedAndExportedKeysSearchCallback, org.dbunit.database.search.ImportedKeysSearchCallback,
AbstractMetaDataBasedSearchCallback | abstract public class AbstractMetaDataBasedSearchCallback extends AbstractNodesFilterSearchCallback (Code) | | Super-class for the ISearchCallback that implements the
getEdges() method using the database meta-data.
author: Felipe Leme version: $Revision: 554 $ since: Aug 25, 2005 |
Field Summary | |
final protected static int | EXPORT | final protected static int[] | FK_INDEXES | final protected static int | IMPORT | final protected static int[] | PK_INDEXES | final protected static int[] | TABLENAME_INDEXES indexes of the column names on the MetaData result sets. |
Method Summary | |
protected static ForeignKeyRelationshipEdge | createFKEdge(ResultSet rs, int type, String from, String to, String fkColumn, String pkColumn) | public IDatabaseConnection | getConnection() Get the connection where the edges will be calculated from. | protected SortedSet | getNodesFromExportedKeys(Object node) Get the nodes using the reverse foreign key dependency, i.e, if table C has
a FK for a table A, then getNodesFromExportedKeys(A) will return C.
NOTE: this method should be used only as an auxiliary
method for sub-classes that also use getNodesFromImportedKeys()
or something similiar, otherwise the generated sequence of tables might not
work when inserted in the database (as some tables might be missing). | protected SortedSet | getNodesFromImportAndExportKeys(Object node) Get the nodes using the both direct and reverse foreign key dependency, i.e,
if table C has a FK for a table A and table A has a FK for a table B, then
getNodesFromImportAndExportedKeys(A) will return B and C. | protected SortedSet | getNodesFromImportedKeys(Object node) Get the nodes using the direct foreign key dependency, i.e, if table A has
a FK for a table B, then getNodesFromImportedKeys(A) will return B. | protected IEdge | newEdge(ResultSet rs, int type, String from, String to, String fkColumn, String pkColumn) This method can be overwritten by the sub-classes if they need to decorate
the edge (for instance, providing an Edge that contains the primary and
foreign keys used). |
EXPORT | final protected static int EXPORT(Code) | | |
FK_INDEXES | final protected static int[] FK_INDEXES(Code) | | |
IMPORT | final protected static int IMPORT(Code) | | |
PK_INDEXES | final protected static int[] PK_INDEXES(Code) | | |
TABLENAME_INDEXES | final protected static int[] TABLENAME_INDEXES(Code) | | indexes of the column names on the MetaData result sets.
|
AbstractMetaDataBasedSearchCallback | public AbstractMetaDataBasedSearchCallback(IDatabaseConnection connection)(Code) | | Defautl constructor.
Parameters: connection - connection where the edges will be calculated from |
createFKEdge | protected static ForeignKeyRelationshipEdge createFKEdge(ResultSet rs, int type, String from, String to, String fkColumn, String pkColumn) throws SearchException(Code) | | Creates an edge representing a foreign key relationship between 2 tables.
Parameters: rs - database meta-data result set Parameters: type - type of relationship (IMPORT or EXPORT) Parameters: from - name of the table representing the 'from' node Parameters: to - name of the table representing the 'to' node Parameters: fkColumn - name of the foreign key column Parameters: pkColumn - name of the primary key column edge representing the relationship between the 2 tables, according to the type throws: SearchException - not thrown in this method (but might on sub-classes) |
getConnection | public IDatabaseConnection getConnection()(Code) | | Get the connection where the edges will be calculated from.
the connection where the edges will be calculated from |
getNodesFromExportedKeys | protected SortedSet getNodesFromExportedKeys(Object node) throws SearchException(Code) | | Get the nodes using the reverse foreign key dependency, i.e, if table C has
a FK for a table A, then getNodesFromExportedKeys(A) will return C.
NOTE: this method should be used only as an auxiliary
method for sub-classes that also use getNodesFromImportedKeys()
or something similiar, otherwise the generated sequence of tables might not
work when inserted in the database (as some tables might be missing).
Parameters: node - table name tables with reverse FK dependency from node throws: SearchException - |
getNodesFromImportAndExportKeys | protected SortedSet getNodesFromImportAndExportKeys(Object node) throws SearchException(Code) | | Get the nodes using the both direct and reverse foreign key dependency, i.e,
if table C has a FK for a table A and table A has a FK for a table B, then
getNodesFromImportAndExportedKeys(A) will return B and C.
Parameters: node - table name tables with reverse and direct FK dependency from node throws: SearchException - |
getNodesFromImportedKeys | protected SortedSet getNodesFromImportedKeys(Object node) throws SearchException(Code) | | Get the nodes using the direct foreign key dependency, i.e, if table A has
a FK for a table B, then getNodesFromImportedKeys(A) will return B.
Parameters: node - table name tables with direct FK dependency from node throws: SearchException - |
newEdge | protected IEdge newEdge(ResultSet rs, int type, String from, String to, String fkColumn, String pkColumn) throws SearchException(Code) | | This method can be overwritten by the sub-classes if they need to decorate
the edge (for instance, providing an Edge that contains the primary and
foreign keys used).
Parameters: rs - database meta-data result set Parameters: type - type of relationship (IMPORT or EXPORT) Parameters: from - name of the table representing the 'from' node Parameters: to - name of the table representing the 'to' node Parameters: fkColumn - name of the foreign key column Parameters: pkColumn - name of the primary key column edge representing the relationship between the 2 tables, according to the type throws: SearchException - not thrown in this method (but might on sub-classes) |
|
|