org.dbunit.database.search
Class ImportedKeysSearchCallbackFilteredByPKs

java.lang.Object
  extended by org.dbunit.util.search.AbstractNodesFilterSearchCallback
      extended by org.dbunit.database.search.AbstractMetaDataBasedSearchCallback
          extended by org.dbunit.database.search.ImportedKeysSearchCallback
              extended by org.dbunit.database.search.ImportedKeysSearchCallbackFilteredByPKs
All Implemented Interfaces:
ISearchCallback

public class ImportedKeysSearchCallbackFilteredByPKs
extends ImportedKeysSearchCallback

Extension of the ImportedKeysSearchCallback, where each new edge is added to a PrimaryKeyFilter.

Since:
Sep 9, 2005
Version:
$Revision: 806 $
Author:
Felipe Leme (dbunit@felipeal.net)

Field Summary
 
Fields inherited from class org.dbunit.database.search.AbstractMetaDataBasedSearchCallback
EXPORT, FK_INDEXES, IMPORT, PK_INDEXES, TABLENAME_INDEXES
 
Fields inherited from class org.dbunit.util.search.AbstractNodesFilterSearchCallback
ALLOW_MODE, DENY_MODE, NO_MODE
 
Constructor Summary
ImportedKeysSearchCallbackFilteredByPKs(IDatabaseConnection connection, PrimaryKeyFilter.PkTableMap allowedPKs)
          Default constructor.
 
Method Summary
 ITableFilter getFilter()
          Get the primary key filter associated with the call back
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).
 void nodeAdded(Object node)
          Do nothing...
 
Methods inherited from class org.dbunit.database.search.ImportedKeysSearchCallback
getEdges
 
Methods inherited from class org.dbunit.database.search.AbstractMetaDataBasedSearchCallback
createFKEdge, getConnection, getNodesFromExportedKeys, getNodesFromImportAndExportKeys, getNodesFromImportedKeys
 
Methods inherited from class org.dbunit.util.search.AbstractNodesFilterSearchCallback
getFilteredNodes, getFilteringMode, searchNode, setAllowedNodes, setAllowedNodes, setDeniedNodes, setDeniedNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportedKeysSearchCallbackFilteredByPKs

public ImportedKeysSearchCallbackFilteredByPKs(IDatabaseConnection connection,
                                               PrimaryKeyFilter.PkTableMap allowedPKs)
Default constructor.

Parameters:
connection - database connection
allowedPKs - map of allowed rows, based on the primary keys (key is the name of a table; value is a Set with allowed primary keys for that table)
Method Detail

getFilter

public ITableFilter getFilter()
Get the primary key filter associated with the call back

Returns:
primary key filter associated with the call back

nodeAdded

public void nodeAdded(Object node)
               throws SearchException
Description copied from class: AbstractNodesFilterSearchCallback
Do nothing...

Specified by:
nodeAdded in interface ISearchCallback
Overrides:
nodeAdded in class AbstractNodesFilterSearchCallback
Parameters:
node - node that has been added.
Throws:
SearchException

newEdge

protected IEdge newEdge(ResultSet rs,
                        int type,
                        String from,
                        String to,
                        String fkColumn,
                        String pkColumn)
                 throws SearchException
Description copied from class: AbstractMetaDataBasedSearchCallback
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).

Overrides:
newEdge in class AbstractMetaDataBasedSearchCallback
Parameters:
rs - database meta-data result set
type - type of relationship (IMPORT or EXPORT)
from - name of the table representing the 'from' node
to - name of the table representing the 'to' node
fkColumn - name of the foreign key column
pkColumn - name of the primary key column
Returns:
edge representing the relationship between the 2 tables, according to the type
Throws:
SearchException - not thrown in this method (but might on sub-classes)


Copyright © 2002-2012. All Rights Reserved.