public class UniqueConstraint extends Constraint
Constructor and Description |
---|
UniqueConstraint(DataColumn column)
Initializes a new instance of the
UniqueConstraint class with the specified DataColumn . |
UniqueConstraint(DataColumn[] columns)
Initializes a new instance of the
UniqueConstraint class with the given array of DataColumn objects. |
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(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. |
Modifier and Type | Method and Description |
---|---|
protected void |
addToConstraintCollectionSetup(ConstraintCollection collection) |
boolean |
equals(java.lang.Object key2)
Compares this constraint to a second to determine if both are identical.
|
DataColumn[] |
getColumns()
Gets the array of columns that this constraint affects.
|
DataTable |
getTable()
Gets the table to which this constraint belongs.
|
int |
hashCode() |
boolean |
isPrimaryKey()
Gets a value indicating whether or not the constraint is on a primary key.
|
getConstraintName, setConstraintName
public UniqueConstraint(java.lang.String name, DataColumn[] columns, boolean isPrimaryKey)
UniqueConstraint
class with the specified name, an array of DataColumn
objects to constrain, and a value specifying whether the constraint is a primary key.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.public UniqueConstraint(DataColumn[] columns, boolean isPrimaryKey)
UniqueConstraint
class with an array of DataColumn
objects to constrain, and a value specifying whether the constraint is a primary key.columns
- An array of DataColumn
objects to constrain.isPrimaryKey
- true to indicate that the constraint is a primary key; otherwise, false.public UniqueConstraint(DataColumn[] columns)
UniqueConstraint
class with the given array of DataColumn
objects.columns
- The array of DataColumn
objects to constrain.public UniqueConstraint(DataColumn column)
UniqueConstraint
class with the specified DataColumn
.column
- The DataColumn
to constrain.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object key2)
equals
in class java.lang.Object
key2
- The object to which this UniqueConstraint
is compared.public DataColumn[] getColumns()
DataColumn
objects.public boolean isPrimaryKey()
public DataTable getTable()
DataTable
to which the constraint belongs.protected void addToConstraintCollectionSetup(ConstraintCollection collection) throws InvalidConstraintException
InvalidConstraintException