UniqueConstraint

Inheritance: java.lang.Object, com.groupdocs.assembly.system.data.Constraint

public class UniqueConstraint extends Constraint

Represents a restriction on a set of columns in which all values must be unique.

Constructors

Constructor Description
UniqueConstraint(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.
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.
UniqueConstraint(DataColumn[] columns) Initializes a new instance of the UniqueConstraint class with the given array of DataColumn objects.
UniqueConstraint(DataColumn column) Initializes a new instance of the UniqueConstraint class with the specified DataColumn.

Methods

Method Description
hashCode()
equals(Object key2) Compares this constraint to a second to determine if both are identical.
getColumns() Gets the array of columns that this constraint affects.
isPrimaryKey() Gets a value indicating whether or not the constraint is on a primary key.
getTable() Gets the table to which this constraint belongs.

UniqueConstraint(String name, DataColumn[] columns, boolean isPrimaryKey)

public UniqueConstraint(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:

Parameter Type Description
name java.lang.String The name of the constraint.
columns DataColumn[] An array of DataColumn objects to constrain.
isPrimaryKey boolean true to indicate that the constraint is a primary key; otherwise, false.

UniqueConstraint(DataColumn[] columns, boolean isPrimaryKey)

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:

Parameter Type Description
columns DataColumn[] An array of DataColumn objects to constrain.
isPrimaryKey boolean true to indicate that the constraint is a primary key; otherwise, false.

UniqueConstraint(DataColumn[] columns)

public UniqueConstraint(DataColumn[] columns)

Initializes a new instance of the UniqueConstraint class with the given array of DataColumn objects.

Parameters:

Parameter Type Description
columns DataColumn[] The array of DataColumn objects to constrain.

UniqueConstraint(DataColumn column)

public UniqueConstraint(DataColumn column)

Initializes a new instance of the UniqueConstraint class with the specified DataColumn.

Parameters:

Parameter Type Description
column DataColumn The DataColumn to constrain.

hashCode()

public int hashCode()

Returns: int

equals(Object key2)

public boolean equals(Object key2)

Compares this constraint to a second to determine if both are identical.

Parameters:

Parameter Type Description
key2 java.lang.Object The object to which this UniqueConstraint is compared.

Returns: boolean - true, if the contraints are equal; otherwise, false.

getColumns()

public DataColumn[] getColumns()

Gets the array of columns that this constraint affects.

Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects.

isPrimaryKey()

public boolean isPrimaryKey()

Gets a value indicating whether or not the constraint is on a primary key.

Returns: boolean - true, if the constraint is on a primary key; otherwise, false.

getTable()

public DataTable getTable()

Gets the table to which this constraint belongs.

Returns: DataTable - The DataTable to which the constraint belongs.