Class RISetChecker
java.lang.Object
org.apache.derby.impl.sql.execute.RISetChecker
Checks a set or referential integrity constraints. Used
to shield the caller from ReferencedKeyRIChecker and
ForeignKeyRICheckers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GenericRIChecker[]
(package private) LanguageConnectionContext
-
Constructor Summary
ConstructorsConstructorDescriptionRISetChecker
(LanguageConnectionContext lcc, TransactionController tc, FKInfo[] fkInfo) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
clean upvoid
doFKCheck
(Activation a, ExecRow row) Check that everything in the row is ok, i.e.void
doPKCheck
(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) Check that there are no referenced primary keys in the passed in row.void
doRICheck
(Activation a, int index, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) Execute the specific RI check on the passed in row.void
void
postCheck
(int index) (package private) void
reopen()
Do any work needed to reopen our ri checkers for another round of checks.
-
Field Details
-
checkers
-
lcc
-
-
Constructor Details
-
RISetChecker
public RISetChecker(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
-
reopen
Do any work needed to reopen our ri checkers for another round of checks. Must do a close() first.- Throws:
StandardException
- on error
-
doPKCheck
public void doPKCheck(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) throws StandardException Check that there are no referenced primary keys in the passed in row. So for each foreign key that references a primary key constraint, make sure that there is no row that matches the values in the passed in row.- Parameters:
a
- The activationrow
- The row to checkrestrictCheckOnly
-true
if the check is relevant only for RESTRICTED referential action.deferredRowReq
- For referenced keys: The required number of duplicates that need to be present. Only used ifpostCheck==false
.- Throws:
StandardException
- on unexpected error, or on a primary/unique key violation
-
postCheck
- Throws:
StandardException
-
postCheck
- Throws:
StandardException
-
doFKCheck
Check that everything in the row is ok, i.e. that there are no foreign keys in the passed in row that have invalid values.- Parameters:
a
- the activationrow
- the row to check- Throws:
StandardException
- on unexpected error, or on a primary/unique key violation
-
doRICheck
public void doRICheck(Activation a, int index, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) throws StandardException Execute the specific RI check on the passed in row.- Parameters:
a
- the activationindex
- index into fkInforow
- the row to checkrestrictCheckOnly
-true
if the check is relevant only for RESTRICTED referential action.deferredRowReq
- For referenced keys: the required number of duplicates that need to be present. Only used ifpostCheck==false
.- Throws:
StandardException
- on unexpected error, or on a primary/unique key violation
-
close
clean up- Throws:
StandardException
- on error
-