Class CheckConstraintDescriptor

    • Field Detail

      • constraintText

        private java.lang.String constraintText
    • Constructor Detail

      • CheckConstraintDescriptor

        CheckConstraintDescriptor​(DataDictionary dataDictionary,
                                  TableDescriptor table,
                                  java.lang.String constraintName,
                                  boolean deferrable,
                                  boolean initiallyDeferred,
                                  UUID constraintId,
                                  java.lang.String constraintText,
                                  ReferencedColumns referencedColumns,
                                  SchemaDescriptor schemaDesc,
                                  boolean isEnabled)
    • Method Detail

      • hasBackingIndex

        public boolean hasBackingIndex()
        Does this constraint have a backing index?
        Specified by:
        hasBackingIndex in class ConstraintDescriptor
        Returns:
        boolean Whether or not there is a backing index for this constraint.
      • getConstraintType

        public int getConstraintType()
        Gets an identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
        Specified by:
        getConstraintType in class ConstraintDescriptor
        Returns:
        An identifier telling what type of descriptor it is (UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK).
      • getConstraintText

        public java.lang.String getConstraintText()
        Get the text of the constraint. (Only non-null/meaningful for check constraints.)
        Overrides:
        getConstraintText in class ConstraintDescriptor
        Returns:
        The constraint text.
      • getConglomerateId

        public UUID getConglomerateId()
        Get the UUID of the backing index, if one exists.
        Specified by:
        getConglomerateId in class ConstraintDescriptor
        Returns:
        The UUID of the backing index, if one exists, else null.
      • getReferencedColumnsDescriptor

        public ReferencedColumns getReferencedColumnsDescriptor()
        Get the ReferencedColumns.
        Returns:
        The ReferencedColumns.
      • setReferencedColumnsDescriptor

        public void setReferencedColumnsDescriptor​(ReferencedColumns rcd)
        Set the ReferencedColumns; used in drop column
        Parameters:
        rcd - The new ReferencedColumns.
      • getReferencedColumns

        public int[] getReferencedColumns()
        Get the referenced columns as an int[] of column ids.
        Overrides:
        getReferencedColumns in class ConstraintDescriptor
        Returns:
        The array of referenced column ids.
      • needsToFire

        public boolean needsToFire​(int stmtType,
                                   int[] modifiedCols)
        Does this constraint need to fire on this type of DML? For a check constraint, all inserts, and appropriate updates
        Specified by:
        needsToFire in class ConstraintDescriptor
        Parameters:
        stmtType - the type of DML (StatementType.INSERT|StatementType.UPDATE|StatementType.DELETE)
        modifiedCols - the columns modified, or null for all
        Returns:
        true/false
      • toString

        public java.lang.String toString()
        Convert the CheckConstraintDescriptor to a String.
        Overrides:
        toString in class ConstraintDescriptor
        Returns:
        A String representation of this CheckConstraintDescriptor