UniqueConstraint

Inheritance: java.lang.Object, com.aspose.words.net.System.Data.Constraint

public class UniqueConstraint extends System.Data.Constraint

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

Constructors

ConstructorDescription
UniqueConstraint(String name, System.Data.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(System.Data.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(System.Data.DataColumn[] columns)Initializes a new instance of the UniqueConstraint class with the given array of DataColumn objects.
UniqueConstraint(System.Data.DataColumn column)Initializes a new instance of the UniqueConstraint class with the specified DataColumn.

Methods

MethodDescription
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.
getConstraintName()The name of a constraint in the ConstraintCollection.
getTable()Gets the table to which this constraint belongs.
hashCode()
isPrimaryKey()Gets a value indicating whether or not the constraint is on a primary key.
setConstraintName(String value)The name of a constraint in the ConstraintCollection.

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

public UniqueConstraint(String name, System.Data.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:

ParameterTypeDescription
namejava.lang.StringThe name of the constraint.
columnsDataColumn[]An array of DataColumn objects to constrain.
isPrimaryKeybooleantrue to indicate that the constraint is a primary key; otherwise, false.

UniqueConstraint(System.Data.DataColumn[] columns, boolean isPrimaryKey)

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

ParameterTypeDescription
columnsDataColumn[]An array of DataColumn objects to constrain.
isPrimaryKeybooleantrue to indicate that the constraint is a primary key; otherwise, false.

UniqueConstraint(System.Data.DataColumn[] columns)

public UniqueConstraint(System.Data.DataColumn[] columns)

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

Parameters:

ParameterTypeDescription
columnsDataColumn[]The array of DataColumn objects to constrain.

UniqueConstraint(System.Data.DataColumn column)

public UniqueConstraint(System.Data.DataColumn column)

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

Parameters:

ParameterTypeDescription
columnDataColumnThe DataColumn to constrain.

equals(Object key2)

public boolean equals(Object key2)

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

Parameters:

ParameterTypeDescription
key2java.lang.ObjectThe object to which this UniqueConstraint is compared.

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

getColumns()

public System.Data.DataColumn[] getColumns()

Gets the array of columns that this constraint affects.

Returns: com.aspose.words.net.System.Data.DataColumn[] - An array of DataColumn objects.

getConstraintName()

public String getConstraintName()

The name of a constraint in the ConstraintCollection.

Returns: java.lang.String - The name of the Constraint.

getTable()

public System.Data.DataTable getTable()

Gets the table to which this constraint belongs.

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

hashCode()

public int hashCode()

Returns: int

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.

setConstraintName(String value)

public void setConstraintName(String value)

The name of a constraint in the ConstraintCollection.

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe name of the Constraint.