Class RISetChecker
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.RISetChecker
-
public class RISetChecker extends java.lang.Object
Checks a set or referential integrity constraints. Used to shield the caller from ReferencedKeyRIChecker and ForeignKeyRICheckers.
-
-
Field Summary
Fields Modifier and Type Field Description private GenericRIChecker[]
checkers
(package private) LanguageConnectionContext
lcc
-
Constructor Summary
Constructors Constructor Description RISetChecker(LanguageConnectionContext lcc, TransactionController tc, FKInfo[] fkInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
postCheck()
void
postCheck(int index)
(package private) void
reopen()
Do any work needed to reopen our ri checkers for another round of checks.
-
-
-
Field Detail
-
checkers
private GenericRIChecker[] checkers
-
lcc
LanguageConnectionContext lcc
-
-
Constructor Detail
-
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 Detail
-
reopen
void reopen() throws StandardException
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
public void postCheck() throws StandardException
- Throws:
StandardException
-
postCheck
public void postCheck(int index) throws StandardException
- Throws:
StandardException
-
doFKCheck
public void doFKCheck(Activation a, ExecRow row) throws StandardException
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
public void close() throws StandardException
clean up- Throws:
StandardException
- on error
-
-