Class ForeignKeyRIChecker
java.lang.Object
org.apache.derby.impl.sql.execute.GenericRIChecker
org.apache.derby.impl.sql.execute.ForeignKeyRIChecker
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 GenericRIChecker
deferredRowsHashTable, fkDcocis, fkInfo, fkScocis, identityMap, indexQualifierRow, lcc, numColumns, refDcoci, refScoci, tc -
Constructor Summary
ConstructorsConstructorDescriptionForeignKeyRIChecker(LanguageConnectionContext lcc, TransactionController tc, FKInfo fkinfo) -
Method Summary
Modifier and TypeMethodDescription(package private) voiddoCheck(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) intGet the isolation level for the scan for the RI check.Methods inherited from class GenericRIChecker
close, getScanController, isAnyFieldNull
-
Constructor Details
-
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 Details
-
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:
doCheckin classGenericRIChecker- Parameters:
a- the activationrow- the row to checkrestrictCheckOnly-trueif 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:
getRICheckIsolationLevelin classGenericRIChecker- Returns:
- The isolation level for the scan for the RI check.
-