DataRelation
Leave feedback
On this page
Inheritance: java.lang.Object
public class DataRelation
Represents a parent/child relationship between two tables.
| 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 columns, and value to create constraints. |
| DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraint) | Initializes a new instance of the DataRelation class using the specified name, parent, and child columns, and value 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. |
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 columns, and value to create constraints.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| relationName | java.lang.String | he 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. |
| parentColumns | DataColumn[] | An array of parent DataColumn objects. |
| childColumns | DataColumn[] | An array of child DataColumn objects. |
| createConstraints | boolean | value that indicates whether to create constraints. true, if constraints are created. Otherwise, false. |
DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraint)
public DataRelation(String relationName, DataColumn parentColumn, DataColumn childColumn, boolean createConstraint)
Initializes a new instance of the DataRelation class using the specified name, parent, and child columns, and value to create constraints.
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. |
| createConstraint | boolean | value that indicates whether to create constraints. true, if constraints are created. Otherwise, false. |
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. |
public String getRelationName()
Returns: java.lang.String - the name used to look up this relation in the parent data set’s DataRelationCollection.
public String getParentTableName()
Returns: java.lang.String - the parent DataTable’s name of this DataRelation.
public String getChildTableName()
Returns: java.lang.String - the child DataTable’s name of this DataRelation.
public DataTable getParentTable()
Returns: DataTable - the parent DataTable of this DataRelation.
public DataTable getChildTable()
Returns: DataTable - the child DataTable of this DataRelation.
public String[] getParentColumnNames()
Returns: java.lang.String[] - the parent DataColumn names of this relation.
public String[] getChildColumnNames()
Returns: java.lang.String[] - the child DataColumn names of this relation.
public DataColumn[] getParentColumns()
Returns: com.groupdocs.assembly.system.data.DataColumn[] - an array of DataColumn objects that are the parent columns of this DataRelation.
public DataColumn[] getChildColumns()
Returns: com.groupdocs.assembly.system.data.DataColumn[] - the child DataColumn objects of this relation.
public void setNested(boolean nested)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| nested | boolean | value that indicates whether DataRelation objects are nested. |
public UniqueConstraint getParentKeyConstraint()
Returns: UniqueConstraint - the UniqueConstraint that guarantees that values in the parent column of a DataRelation are unique.
public void setParentKeyConstraint(UniqueConstraint parentKeyConstraint)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| parentKeyConstraint | UniqueConstraint |
public ForeignKeyConstraint getChildKeyConstraint()
Returns: ForeignKeyConstraint - the ForeignKeyConstraint for the relation.
public void setChildKeyConstraint(ForeignKeyConstraint childKeyConstraint)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| childKeyConstraint | ForeignKeyConstraint |
public DataKey getChildKey()
Returns: DataKey
public DataKey getParentKey()
Returns: DataKey
public DataSet getDataSet()
Returns: DataSet
public int hashCode()
Returns: int
public boolean equals(Object obj)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object |
Returns: boolean
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.