|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbunit.util.search.AbstractNodesFilterSearchCallback org.dbunit.database.search.AbstractMetaDataBasedSearchCallback
public abstract class AbstractMetaDataBasedSearchCallback
Super-class for the ISearchCallback that implements the
getEdges()
method using the database meta-data.
Field Summary | |
---|---|
protected static int |
EXPORT
|
protected static int[] |
FK_INDEXES
|
protected static int |
IMPORT
|
protected static int[] |
PK_INDEXES
|
protected static int[] |
TABLENAME_INDEXES
indexes of the column names on the MetaData result sets. |
Fields inherited from class org.dbunit.util.search.AbstractNodesFilterSearchCallback |
---|
ALLOW_MODE, DENY_MODE, NO_MODE |
Constructor Summary | |
---|---|
AbstractMetaDataBasedSearchCallback(IDatabaseConnection connection)
Defautl constructor. |
Method Summary | |
---|---|
protected static ForeignKeyRelationshipEdge |
createFKEdge(java.sql.ResultSet rs,
int type,
java.lang.String from,
java.lang.String to,
java.lang.String fkColumn,
java.lang.String pkColumn)
Creates an edge representing a foreign key relationship between 2 tables. |
IDatabaseConnection |
getConnection()
Get the connection where the edges will be calculated from. |
protected java.util.SortedSet |
getNodesFromExportedKeys(java.lang.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. |
protected java.util.SortedSet |
getNodesFromImportAndExportKeys(java.lang.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 java.util.SortedSet |
getNodesFromImportedKeys(java.lang.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(java.sql.ResultSet rs,
int type,
java.lang.String from,
java.lang.String to,
java.lang.String fkColumn,
java.lang.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). |
Methods inherited from class org.dbunit.util.search.AbstractNodesFilterSearchCallback |
---|
getFilteredNodes, getFilteringMode, nodeAdded, searchNode, setAllowedNodes, setAllowedNodes, setDeniedNodes, setDeniedNodes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.dbunit.util.search.ISearchCallback |
---|
getEdges |
Field Detail |
---|
protected static final int IMPORT
protected static final int EXPORT
protected static final int[] TABLENAME_INDEXES
protected static final int[] PK_INDEXES
protected static final int[] FK_INDEXES
Constructor Detail |
---|
public AbstractMetaDataBasedSearchCallback(IDatabaseConnection connection)
connection
- connection where the edges will be calculated fromMethod Detail |
---|
public IDatabaseConnection getConnection()
protected java.util.SortedSet getNodesFromImportedKeys(java.lang.Object node) throws SearchException
node
- table name
SearchException
protected java.util.SortedSet getNodesFromExportedKeys(java.lang.Object node) throws SearchException
getNodesFromImportedKeys()
or something similiar, otherwise the generated sequence of tables might not
work when inserted in the database (as some tables might be missing).
node
- table name
SearchException
protected java.util.SortedSet getNodesFromImportAndExportKeys(java.lang.Object node) throws SearchException
node
- table name
SearchException
protected static ForeignKeyRelationshipEdge createFKEdge(java.sql.ResultSet rs, int type, java.lang.String from, java.lang.String to, java.lang.String fkColumn, java.lang.String pkColumn) throws SearchException
rs
- database meta-data result settype
- type of relationship (IMPORT or EXPORT)from
- name of the table representing the 'from' nodeto
- name of the table representing the 'to' nodefkColumn
- name of the foreign key columnpkColumn
- name of the primary key column
SearchException
- not thrown in this method (but might on sub-classes)protected IEdge newEdge(java.sql.ResultSet rs, int type, java.lang.String from, java.lang.String to, java.lang.String fkColumn, java.lang.String pkColumn) throws SearchException
rs
- database meta-data result settype
- type of relationship (IMPORT or EXPORT)from
- name of the table representing the 'from' nodeto
- name of the table representing the 'to' nodefkColumn
- name of the foreign key columnpkColumn
- name of the primary key column
SearchException
- not thrown in this method (but might on sub-classes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |