ForeignKeyConstraint

Inheritance: java.lang.Object, com.groupdocs.assembly.system.data.Constraint

public class ForeignKeyConstraint extends 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, DataColumn[] parentColumns, DataColumn[] childColumns) Initializes a new instance of the ForeignKeyConstraint class with the specified name, and arrays of parent and child DataColumn objects.
ForeignKeyConstraint(DataColumn parentColumn, DataColumn childColumn) Initializes a new instance of the ForeignKeyConstraint class with the specified parent and child DataColumn objects.
ForeignKeyConstraint(String constraintName, DataColumn parentColumn, DataColumn childColumn) Initializes a new instance of the ForeignKeyConstraint class with the specified name, parent and child DataColumn objects.

Methods

Method Description
getDeleteRule() Gets the action that occurs across this constraint when a row is deleted.
getUpdateRule() Gets the action that occurs across this constraint on when a row is updated.
hashCode()
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.
getRelatedColumns() The parent columns of this constraint.
getTable() Gets the child table of this constraint.
getRelatedTable() Gets the parent table of this constraint.

ForeignKeyConstraint(String constraintName, DataColumn[] parentColumns, DataColumn[] childColumns)

public ForeignKeyConstraint(String constraintName, DataColumn[] parentColumns, 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(DataColumn parentColumn, DataColumn childColumn)

public ForeignKeyConstraint(DataColumn parentColumn, 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, DataColumn parentColumn, DataColumn childColumn)

public ForeignKeyConstraint(String constraintName, DataColumn parentColumn, 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.

getDeleteRule()

public 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.

getUpdateRule()

public 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

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 DataColumn[] getColumns()

Gets the child columns of this constraint.

Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects that are the child columns of the constraint.

getRelatedColumns()

public DataColumn[] getRelatedColumns()

The parent columns of this constraint.

Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects that are the parent columns of the constraint.

getTable()

public DataTable getTable()

Gets the child table of this constraint.

Returns: DataTable - A DataTable that is the child table in the constraint.

getRelatedTable()

public DataTable getRelatedTable()

Gets the parent table of this constraint.

Returns: DataTable - The parent DataTable of this constraint.