com.groupdocs.assembly.system.data

Class UniqueConstraint



  • public final class UniqueConstraint
    extends Constraint
    Represents a restriction on a set of columns in which all values must be unique.
    • Constructor Detail

      • UniqueConstraint

        public UniqueConstraint(java.lang.String name,
                                DataColumn[] columns,
                                boolean isPrimaryKey)
        Initializes a new instance of the UniqueConstraint class with the specified name, an array of DataColumn objects to constrain, and a value specifying whether the constraint is a primary key.
        Parameters:
        name - The name of the constraint.
        columns - An array of DataColumn objects to constrain.
        isPrimaryKey - true to indicate that the constraint is a primary key; otherwise, false.
      • UniqueConstraint

        public UniqueConstraint(DataColumn[] columns,
                                boolean isPrimaryKey)
        Initializes a new instance of the UniqueConstraint class with an array of DataColumn objects to constrain, and a value specifying whether the constraint is a primary key.
        Parameters:
        columns - An array of DataColumn objects to constrain.
        isPrimaryKey - true to indicate that the constraint is a primary key; otherwise, false.
      • UniqueConstraint

        public UniqueConstraint(DataColumn[] columns)
        Initializes a new instance of the UniqueConstraint class with the given array of DataColumn objects.
        Parameters:
        columns - The array of DataColumn objects to constrain.
    • Method Detail

      • hashCode

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

        public final boolean equals(java.lang.Object key2)
        Compares this constraint to a second to determine if both are identical.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        key2 - The object to which this UniqueConstraint is compared.
        Returns:
        true, if the contraints are equal; otherwise, false.
      • getColumns

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

        public final boolean isPrimaryKey()
        Gets a value indicating whether or not the constraint is on a primary key.
        Returns:
        true, if the constraint is on a primary key; otherwise, false.
      • getTable

        public final DataTable getTable()
        Gets the table to which this constraint belongs.
        Returns:
        The DataTable to which the constraint belongs.