DataRelation
Inheritance: java.lang.Object
public final class DataRelation
Represents a parent/child relationship between two DataTable objects.
Constructors
Constructor | Description |
---|---|
DataRelation(String relationName, DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames) | Initializes a new instance of the DataRelation class using the specified name, parent and child tables, matched arrays of parent and child columns. |
DataRelation(String relationName, DataColumn[] parentColumns, DataColumn[] childColumns, boolean createConstraints) | Initializes a new instance of the DataRelation class using the specified name, matched arrays of parent and child DataColumn objects, and value that indicates whether to create constraints. |
DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints) | Initializes a new instance of the DataRelation class using the specified name, parent and child DataColumn objects, and a value that indicates whether to create constraints. |
DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn) | Initializes a new instance of the DataRelation class using the specified DataRelation name, and parent and child DataColumn objects. |
Methods
DataRelation(String relationName, DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
public DataRelation(String relationName, DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
Initializes a new instance of the DataRelation class using the specified name, parent and child tables, matched arrays of parent and child columns.
Parameters:
Parameter | Type | Description |
---|---|---|
relationName | java.lang.String | The name of the DataRelation. If null or an empty string (""), a default name will be given when the created object is added to the DataRelationCollection. |
parentTable | DataTable | The parent table in the relationship. |
childTable | DataTable | The child table in the relationship. |
parentColumnNames | java.lang.String[] | The parent DataColumn’s name in the relationship. |
childColumnNames | java.lang.String[] | The child DataColumn;s in the relationship. |
DataRelation(String relationName, DataColumn[] parentColumns, DataColumn[] childColumns, boolean createConstraints)
public DataRelation(String relationName, DataColumn[] parentColumns, DataColumn[] childColumns, boolean createConstraints)
Initializes a new instance of the DataRelation class using the specified name, matched arrays of parent and child DataColumn objects, and value that indicates whether to create constraints.
Parameters:
Parameter | Type | Description |
---|---|---|
relationName | java.lang.String | The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the DataRelationCollection. |
parentColumns | DataColumn[] | An array of parent DataColumn objects. |
childColumns | DataColumn[] | An array of child DataColumn objects. |
createConstraints | boolean | A value that indicates whether to create constraints. true, if constraints are created. Otherwise, false. |
DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)
public DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)
Initializes a new instance of the DataRelation class using the specified name, parent and child DataColumn objects, and a value that indicates whether to create constraints.
Parameters:
Parameter | Type | Description |
---|---|---|
relationName | java.lang.String | The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the DataRelationCollection. |
parentColumn | DataColumn | The parent DataColumn in the relation. |
childColumn | DataColumn | The child DataColumn in the relation. |
createConstraints | boolean | A value that indicates whether constraints are created. true, if constraints are created. Otherwise, false. |
DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn)
public DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn)
Initializes a new instance of the DataRelation class using the specified DataRelation name, and parent and child DataColumn objects.
Parameters:
Parameter | Type | Description |
---|---|---|
relationName | java.lang.String | The name of the DataRelation. If null or an empty string (""), a default name will be given when the created object is added to the DataRelationCollection. |
parentColumn | DataColumn | The parent DataColumn in the relationship. |
childColumn | DataColumn | The child DataColumn in the relationship. |
getRelationName()
public final String getRelationName()
Gets the name used to retrieve a DataRelation from the DataRelationCollection.
Returns: java.lang.String - The name of the a DataRelation.
getParentTableName()
public final String getParentTableName()
Returns: java.lang.String - the parent DataTable’s name of this DataRelation.
getChildTableName()
public final String getChildTableName()
Returns: java.lang.String - the child DataTable’s name of this DataRelation.
getParentTable()
public final DataTable getParentTable()
Gets the parent DataTable of this DataRelation.
Returns: DataTable - A DataTable that is the parent table of this relation.
getChildTable()
public final DataTable getChildTable()
Gets the child table of this relation.
Returns: DataTable - A DataTable that is the child table of the relation.
getParentColumnNames()
public final String[] getParentColumnNames()
Returns: java.lang.String[] - the parent DataColumn names of this relation.
getChildColumnNames()
public final String[] getChildColumnNames()
Returns: java.lang.String[] - the child DataColumn names of this relation.
getParentColumns()
public final DataColumn[] getParentColumns()
Gets an array of DataColumn objects that are the parent columns of this DataRelation.
Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects that are the parent columns of this DataRelation.
getChildColumns()
public final DataColumn[] getChildColumns()
Gets the child DataColumn objects of this relation.
Returns: com.groupdocs.assembly.system.data.DataColumn[] - An array of DataColumn objects.
setNested(boolean value)
public final void setNested(boolean value)
Sets a value that indicates whether DataRelation objects are nested.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | true, if DataRelation objects are nested; otherwise, false. |
getParentKeyConstraint()
public final UniqueConstraint getParentKeyConstraint()
Gets the UniqueConstraint that guarantees that values in the parent column of a DataRelation are unique.
Returns: UniqueConstraint - A UniqueConstraint that makes sure that values in a parent column are unique.
setParentKeyConstraint(UniqueConstraint parentKeyConstraint)
public final void setParentKeyConstraint(UniqueConstraint parentKeyConstraint)
Parameters:
Parameter | Type | Description |
---|---|---|
parentKeyConstraint | UniqueConstraint |
getChildKeyConstraint()
public final ForeignKeyConstraint getChildKeyConstraint()
Gets the ForeignKeyConstraint for the relation.
Returns: ForeignKeyConstraint - A ForeignKeyConstraint.
setChildKeyConstraint(ForeignKeyConstraint childKeyConstraint)
public final void setChildKeyConstraint(ForeignKeyConstraint childKeyConstraint)
Parameters:
Parameter | Type | Description |
---|---|---|
childKeyConstraint | ForeignKeyConstraint |
getChildKey()
public final DataKey getChildKey()
Returns: DataKey
getParentKey()
public final DataKey getParentKey()
Returns: DataKey
getDataSet()
public final DataSet getDataSet()
Gets the DataSet to which the DataRelation belongs.
Returns: DataSet - A DataSet to which the DataRelation belongs.
hashCode()
public final int hashCode()
Returns: int
equals(Object obj)
public final boolean equals(Object obj)
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object |
Returns: boolean