com.groupdocs.assembly.system.data

Class ForeignKeyConstraint



  • public final class ForeignKeyConstraint
    extends Constraint
    Represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated.
    • Constructor Detail

      • ForeignKeyConstraint

        public ForeignKeyConstraint(java.lang.String constraintName,
                                    DataColumn[] parentColumns,
                                    DataColumn[] childColumns)
        Initializes a new instance of the ForeignKeyConstraint class with the specified name, and arrays of parent and child DataColumn objects.
        Parameters:
        constraintName - The name of the ForeignKeyConstraint. If null or empty string, a default name will be given when added to the constraints collection.
        parentColumns - An array of parent DataColumn in the constraint.
        childColumns - An array of child DataColumn in the constraint.
      • ForeignKeyConstraint

        public ForeignKeyConstraint(java.lang.String constraintName,
                                    DataColumn parentColumn,
                                    DataColumn childColumn)
        Initializes a new instance of the ForeignKeyConstraint class with the specified name, parent and child DataColumn objects.
        Parameters:
        constraintName - The name of the constraint.
        parentColumn - The parent DataColumn in the constraint.
        childColumn - The child DataColumn in the constraint.
    • Method Detail

      • getDeleteRule

        public final Rule getDeleteRule()
        Gets the action that occurs across this constraint when a row is deleted.
        Returns:
        One of the Rule values. The default is Cascade. The returned value is one of Rule constants.
      • getUpdateRule

        public final Rule getUpdateRule()
        Gets the action that occurs across this constraint on when a row is updated.
        Returns:
        One of the Rule values. The default is Cascade. The returned value is one of Rule constants.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals(java.lang.Object key)
        Gets a value indicating whether the current ForeignKeyConstraint is identical to the specified object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        key - The object to which this ForeignKeyConstraint is compared. Two ForeignKeyConstraint are equal if they constrain the same columns.
        Returns:
        true, if the objects are identical; otherwise, false.
      • getColumns

        public final DataColumn[] getColumns()
        Gets the child columns of this constraint.
        Returns:
        An array of DataColumn objects that are the child columns of the constraint.
      • getRelatedColumns

        public final DataColumn[] getRelatedColumns()
        The parent columns of this constraint.
        Returns:
        An array of DataColumn objects that are the parent columns of the constraint.
      • getTable

        public final DataTable getTable()
        Gets the child table of this constraint.
        Returns:
        A DataTable that is the child table in the constraint.
      • getRelatedTable

        public final DataTable getRelatedTable()
        Gets the parent table of this constraint.
        Returns:
        The parent DataTable of this constraint.