Class CreateConstraintConstantAction

All Implemented Interfaces:
ConstantAction

public class CreateConstraintConstantAction extends ConstraintConstantAction
This class describes actions that are ALWAYS performed for a constraint creation at Execution time.
Version:
0.1
  • Field Details

    • forCreateTable

      private final boolean forCreateTable
    • columnNames

      private String[] columnNames
    • constraintText

      private String constraintText
    • otherConstraintInfo

      private ConstraintInfo otherConstraintInfo
    • cf

      private ClassFactory cf
    • enabled

      private boolean enabled
    • characteristics

      private boolean[] characteristics
    • providerInfo

      private ProviderInfo[] providerInfo
  • Constructor Details

    • CreateConstraintConstantAction

      CreateConstraintConstantAction(String constraintName, int constraintType, boolean[] characteristics, boolean forCreateTable, String tableName, UUID tableId, String schemaName, String[] columnNames, IndexConstantAction indexAction, String constraintText, ConstraintInfo otherConstraint, ProviderInfo[] providerInfo)
      Make one of these puppies.
      Parameters:
      constraintName - Constraint name.
      constraintType - Constraint type.
      characteristics - Constraint characteristics
      forCreateTable - Constraint is being added for a CREATE TABLE
      tableName - Table name.
      tableId - UUID of table.
      schemaName - the schema that table and constraint lives in.
      columnNames - String[] for column names
      indexAction - IndexConstantAction for constraint (if necessary)
      constraintText - Text for check constraint
      otherConstraint - information about the constraint that this references
      providerInfo - Information on all the Providers
  • Method Details

    • executeConstantAction

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

      A constraint is represented as:

      • ConstraintDescriptor.
      If a backing index is required then the index will be created through an CreateIndexConstantAction setup by the compiler.
      Dependencies are created as:
      • ConstraintDescriptor depends on all the providers collected at compile time and passed into the constructor.
      • For a FOREIGN KEY constraint ConstraintDescriptor depends on the ConstraintDescriptor for the referenced constraints and the privileges required to create the constraint.
      Parameters:
      activation - The execution environment for this constant action.
      Throws:
      StandardException - Thrown on failure
      See Also:
    • isForeignKeyConstraint

      boolean isForeignKeyConstraint()
      Is the constant action for a foreign key
      Returns:
      true/false
    • isInitiallyDeferred

      boolean isInitiallyDeferred()
    • genColumnPositions

      private int[] genColumnPositions(TableDescriptor td, boolean columnsMustBeOrderable) throws StandardException
      Generate an array of column positions for the column list in the constraint.
      Parameters:
      td - The TableDescriptor for the table in question
      columnsMustBeOrderable - true for primaryKey and unique constraints
      Returns:
      int[] The column positions.
      Throws:
      StandardException
    • getConstraintText

      String getConstraintText()
      Get the text defining this constraint.
      Returns:
      constraint text
    • toString

      public String toString()
      Overrides:
      toString in class Object