org.apache.derby.impl.sql.execute
Class ForeignKeyRIChecker

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.GenericRIChecker
      extended by org.apache.derby.impl.sql.execute.ForeignKeyRIChecker

public class ForeignKeyRIChecker
extends GenericRIChecker

A Referential Integrity checker for a foreign key constraint. It makes sure the foreign key is intact. This is used for a change to a foreign key column. see ReferencedKeyRIChecker for the code that validates changes to referenced keys.


Field Summary
 
Fields inherited from class org.apache.derby.impl.sql.execute.GenericRIChecker
fkDcocis, fkInfo, fkScocis, refDcoci, refScoci, tc
 
Constructor Summary
ForeignKeyRIChecker(TransactionController tc, FKInfo fkinfo)
           
 
Method Summary
(package private)  void doCheck(ExecRow row, boolean restrictCheckOnly)
          Check that the row either has a null column(s), or corresponds to a row in the referenced key.
(package private)  int getRICheckIsolationLevel()
          Get the isolation level for the scan for the RI check.
 
Methods inherited from class org.apache.derby.impl.sql.execute.GenericRIChecker
close, doCheck, getScanController, isAnyFieldNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForeignKeyRIChecker

ForeignKeyRIChecker(TransactionController tc,
                    FKInfo fkinfo)
              throws StandardException
Parameters:
tc - the xact controller
fkinfo - the foreign key information
Throws:
StandardException - Thrown on failure
Method Detail

doCheck

void doCheck(ExecRow row,
             boolean restrictCheckOnly)
       throws StandardException
Check that the row either has a null column(s), or corresponds to a row in the referenced key.

If the referenced key is found, then it is locked when this method returns. The lock is held until the next call to doCheck() or close().

Specified by:
doCheck in class GenericRIChecker
Parameters:
row - the row to check
Throws:
StandardException - on unexped error, or on a foreign key violation

getRICheckIsolationLevel

int getRICheckIsolationLevel()
Get the isolation level for the scan for the RI check. NOTE: The level will eventually be instantaneous locking once the implemenation changes.

Overrides:
getRICheckIsolationLevel in class GenericRIChecker
Returns:
The isolation level for the scan for the RI check.

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.