UniqueConstraint
Leave feedback
On this page
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.
| 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. |
| 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. |
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. |
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. |
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. |
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. |
public int hashCode()
Returns: int
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.
public DataColumn[] getColumns()
Gets the array of columns that this constraint affects.
Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects.
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.
public DataTable getTable()
Gets the table to which this constraint belongs.
Returns: DataTable - The DataTable to which the constraint belongs.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.