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

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.DDLConstantAction
      extended by org.apache.derby.impl.sql.execute.SetConstraintsConstantAction
All Implemented Interfaces:
ConstantAction

 class SetConstraintsConstantAction
extends DDLConstantAction

This class describes actions that are performed for a set constraint at Execution time.

Note that the dependency action we send is SET_CONSTRAINTS rather than ALTER_TABLE. We do this because we want to distinguish SET_CONSTRAINTS from ALTER_TABLE for error messages.


Field Summary
private  ConstraintDescriptorList cdl
           
private  UUID[] cuuids
           
private  boolean enable
           
private  UUID[] tuuids
           
private  boolean unconditionallyEnforce
           
 
Constructor Summary
SetConstraintsConstantAction(ConstraintDescriptorList cdl, boolean enable, boolean unconditionallyEnforce)
          Boilerplate
 
Method Summary
 void executeConstantAction(Activation activation)
          This is the guts of the Execution-time logic for DROP CONSTRAINT.
private  ConstraintDescriptorList getConstraintDescriptorList(DataDictionary dd)
           
private  RowLocation getRowLocation(DataDictionary dd, TableDescriptor td, TransactionController tc)
           
protected  void publishToTargets(Activation activation)
          Do the work of publishing any this action to any replication targets.
 java.lang.String toString()
           
private  void validateAllCheckConstraints(LanguageConnectionContext lcc, java.util.Hashtable ht)
           
private  void validateFKConstraint(ForeignKeyConstraintDescriptor fk, DataDictionary dd, TransactionController tc, ContextManager cm)
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.DDLConstantAction
addColumnDependencies, adjustUDTDependencies, adjustUDTDependencies, constructToString, getAndCheckSchemaDescriptor, getSchemaDescriptorForCreate, lockTableForDDL, storeConstraintDependenciesOnPrivileges, storeViewTriggerDependenciesOnPrivileges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enable

private boolean enable

unconditionallyEnforce

private boolean unconditionallyEnforce

cdl

private ConstraintDescriptorList cdl

cuuids

private UUID[] cuuids

tuuids

private UUID[] tuuids
Constructor Detail

SetConstraintsConstantAction

SetConstraintsConstantAction(ConstraintDescriptorList cdl,
                             boolean enable,
                             boolean unconditionallyEnforce)
Boilerplate

Parameters:
cdl - ConstraintDescriptorList
enable - true == turn them on, false == turn them off
unconditionallyEnforce - Replication sets this to true at the end of REFRESH. This forces us to run the included foreign key constraints even if they're already marked ENABLED.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

executeConstantAction

public void executeConstantAction(Activation activation)
                           throws StandardException
This is the guts of the Execution-time logic for DROP CONSTRAINT.

Parameters:
activation - The execution environment for this constant action.
Throws:
StandardException - Thrown on failure
See Also:
ConstantAction.executeConstantAction(org.apache.derby.iapi.sql.Activation)

validateAllCheckConstraints

private void validateAllCheckConstraints(LanguageConnectionContext lcc,
                                         java.util.Hashtable ht)
                                  throws StandardException
Throws:
StandardException

validateFKConstraint

private void validateFKConstraint(ForeignKeyConstraintDescriptor fk,
                                  DataDictionary dd,
                                  TransactionController tc,
                                  ContextManager cm)
                           throws StandardException
Throws:
StandardException

getRowLocation

private RowLocation getRowLocation(DataDictionary dd,
                                   TableDescriptor td,
                                   TransactionController tc)
                            throws StandardException
Throws:
StandardException

getConstraintDescriptorList

private ConstraintDescriptorList getConstraintDescriptorList(DataDictionary dd)
                                                      throws StandardException
Throws:
StandardException

publishToTargets

protected void publishToTargets(Activation activation)
                         throws StandardException
Do the work of publishing any this action to any replication targets. On a non-replicated source, this is a no-op.

Parameters:
activation - the activation
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.