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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
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(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:
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(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:
Parameter | Type | Description |
---|---|---|
columns | DataColumn[] | 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:
Parameter | Type | Description |
---|---|---|
column | DataColumn | The DataColumn to constrain. |
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 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:
Parameter | Type | Description |
---|---|---|
value | java.lang.String | The name of the Constraint. |