Class ForeignKeyRIChecker
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.GenericRIChecker
-
- 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
deferredRowsHashTable, fkDcocis, fkInfo, fkScocis, identityMap, indexQualifierRow, lcc, numColumns, refDcoci, refScoci, tc
-
-
Constructor Summary
Constructors Constructor Description ForeignKeyRIChecker(LanguageConnectionContext lcc, TransactionController tc, FKInfo fkinfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
doCheck(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq)
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, getScanController, isAnyFieldNull
-
-
-
-
Constructor Detail
-
ForeignKeyRIChecker
ForeignKeyRIChecker(LanguageConnectionContext lcc, TransactionController tc, FKInfo fkinfo) throws StandardException
- Parameters:
lcc
- the language connection contexttc
- the xact controllerfkinfo
- the foreign key information- Throws:
StandardException
- Thrown on failure
-
-
Method Detail
-
doCheck
void doCheck(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) 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 classGenericRIChecker
- Parameters:
a
- the activationrow
- the row to checkrestrictCheckOnly
-true
if the check is relevant only for RESTRICTED referential action.deferredRowReq
- dummy (interface obligation only)- Throws:
StandardException
- on unexpected 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 implementation changes.- Overrides:
getRICheckIsolationLevel
in classGenericRIChecker
- Returns:
- The isolation level for the scan for the RI check.
-
-