ForeignKeyConstraint
Inheritance: java.lang.Object, com.aspose.words.net.System.Data.Constraint
public class ForeignKeyConstraint extends System.Data.Constraint
Represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated.
Constructors
| Constructor | Description |
|---|---|
| ForeignKeyConstraint(String constraintName, System.Data.DataColumn[] parentColumns, System.Data.DataColumn[] childColumns) | Initializes a new instance of the ForeignKeyConstraint class with the specified name, and arrays of parent and child DataColumn objects. |
| ForeignKeyConstraint(System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn) | Initializes a new instance of the ForeignKeyConstraint class with the specified parent and child DataColumn objects. |
| ForeignKeyConstraint(String constraintName, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn) | Initializes a new instance of the ForeignKeyConstraint class with the specified name, parent and child DataColumn objects. |
Methods
| Method | Description |
|---|---|
| equals(Object key) | Gets a value indicating whether the current ForeignKeyConstraint is identical to the specified object. |
| getColumns() | Gets the child columns of this constraint. |
| getConstraintName() | The name of a constraint in the ConstraintCollection. |
| getDeleteRule() | Gets the action that occurs across this constraint when a row is deleted. |
| getRelatedColumns() | The parent columns of this constraint. |
| getRelatedTable() | Gets the parent table of this constraint. |
| getTable() | Gets the child table of this constraint. |
| getUpdateRule() | Gets the action that occurs across this constraint on when a row is updated. |
| hashCode() | |
| setConstraintName(String value) | The name of a constraint in the ConstraintCollection. |
ForeignKeyConstraint(String constraintName, System.Data.DataColumn[] parentColumns, System.Data.DataColumn[] childColumns)
public ForeignKeyConstraint(String constraintName, System.Data.DataColumn[] parentColumns, System.Data.DataColumn[] childColumns)
Initializes a new instance of the ForeignKeyConstraint class with the specified name, and arrays of parent and child DataColumn objects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| constraintName | java.lang.String | The name of the ForeignKeyConstraint. If null or empty string, a default name will be given when added to the constraints collection. |
| parentColumns | DataColumn[] | An array of parent DataColumn in the constraint. |
| childColumns | DataColumn[] | An array of child DataColumn in the constraint. |
ForeignKeyConstraint(System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
public ForeignKeyConstraint(System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
Initializes a new instance of the ForeignKeyConstraint class with the specified parent and child DataColumn objects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| parentColumn | DataColumn | The parent DataColumn in the constraint. |
| childColumn | DataColumn | The child DataColumn in the constraint. |
ForeignKeyConstraint(String constraintName, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
public ForeignKeyConstraint(String constraintName, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn)
Initializes a new instance of the ForeignKeyConstraint class with the specified name, parent and child DataColumn objects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| constraintName | java.lang.String | The name of the constraint. |
| parentColumn | DataColumn | The parent DataColumn in the constraint. |
| childColumn | DataColumn | The child DataColumn in the constraint. |
equals(Object key)
public boolean equals(Object key)
Gets a value indicating whether the current ForeignKeyConstraint is identical to the specified object.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| key | java.lang.Object | The object to which this ForeignKeyConstraint is compared. Two ForeignKeyConstraint are equal if they constrain the same columns. |
Returns: boolean - true, if the objects are identical; otherwise, false.
getColumns()
public System.Data.DataColumn[] getColumns()
Gets the child columns of this constraint.
Returns: com.aspose.words.net.System.Data.DataColumn[] - An array of DataColumn objects that are the child columns of the constraint.
getConstraintName()
public String getConstraintName()
The name of a constraint in the ConstraintCollection.
Returns: java.lang.String - The name of the Constraint.
getDeleteRule()
public System.Data.Rule getDeleteRule()
Gets the action that occurs across this constraint when a row is deleted.
Returns: Rule - One of the Rule values. The default is Cascade. The returned value is one of Rule constants.
getRelatedColumns()
public System.Data.DataColumn[] getRelatedColumns()
The parent columns of this constraint.
Returns: com.aspose.words.net.System.Data.DataColumn[] - An array of DataColumn objects that are the parent columns of the constraint.
getRelatedTable()
public System.Data.DataTable getRelatedTable()
Gets the parent table of this constraint.
Returns: DataTable - The parent DataTable of this constraint.
getTable()
public System.Data.DataTable getTable()
Gets the child table of this constraint.
Returns: DataTable - A DataTable that is the child table in the constraint.
getUpdateRule()
public System.Data.Rule getUpdateRule()
Gets the action that occurs across this constraint on when a row is updated.
Returns: Rule - One of the Rule values. The default is Cascade. The returned value is one of Rule constants.
hashCode()
public int hashCode()
Returns: int
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. |