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

java.lang.Object
  extended by 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
private  GenericRIChecker[] checkers
           
 
Constructor Summary
RISetChecker(TransactionController tc, FKInfo[] fkInfo)
           
 
Method Summary
 void close()
          clean up
 void doFKCheck(ExecRow row)
          Check that everything in the row is ok, i.e.
 void doPKCheck(ExecRow row, boolean restrictCheckOnly)
          Check that there are no referenced primary keys in the passed in row.
 void doRICheck(int index, ExecRow row, boolean restrictCheckOnly)
          Execute the specific RI check on the passed in row.
(package private)  void reopen()
          Do any work needed to reopen our ri checkers for another round of checks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkers

private GenericRIChecker[] checkers
Constructor Detail

RISetChecker

public RISetChecker(TransactionController tc,
                    FKInfo[] fkInfo)
             throws StandardException
Parameters:
tc - the xact controller
fkInfo - 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(ExecRow row,
                      boolean restrictCheckOnly)
               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:
row - the row to check
Throws:
StandardException - on unexpected error, or on a primary/unique key violation

doFKCheck

public void doFKCheck(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:
row - the row to check
Throws:
StandardException - on unexpected error, or on a primary/unique key violation

doRICheck

public void doRICheck(int index,
                      ExecRow row,
                      boolean restrictCheckOnly)
               throws StandardException
Execute the specific RI check on the passed in row.

Parameters:
index - index into fkInfo
row - the row to check
Throws:
StandardException - on unexpected error, or on a primary/unique key violation

close

public void close()
           throws StandardException
clean up

Throws:
StandardException - on error

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

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