DataRelationCollection
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.Iterable
public class DataRelationCollection implements Iterable<DataRelation>
Represents the collection of relations, each of which allows navigation between related parent/child tables.
public void add(DataRelation relation)
Adds a relation to the collection. Performs no checks on the duplication etc.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| relation | DataRelation | the DataRelation to add to the collection. |
public void add(DataTable parentTable, DataTable childTable, String parentColumnName, String childColumnName)
Adds a relation to the collection. Performs no checks on the duplication etc.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| parentTable | DataTable | The parent table of the relation. |
| childTable | DataTable | The child table of the relation. |
| parentColumnName | java.lang.String | The parent column’s name of the relation. |
| childColumnName | java.lang.String | The child column’s name of the relation. |
add(DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
public void add(DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames)
Adds a relation to the collection. Performs no checks on the duplication etc.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| parentTable | DataTable | The parent table of the relation. |
| childTable | DataTable | The child table of the relation. |
| parentColumnNames | java.lang.String[] | The array of parent column’s name of the relation. |
| childColumnNames | java.lang.String[] | The array of child column’s name of the relation. |
public void add(String name, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | |
| parentColumn | DataColumn | |
| childColumn | DataColumn | |
| createConstraints | boolean |
public void add(DataColumn parentColumn, DataColumn childColumn)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| parentColumn | DataColumn | |
| childColumn | DataColumn |
public void add(String name, DataColumn parentColumn, DataColumn childColumn)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | |
| parentColumn | DataColumn | |
| childColumn | DataColumn |
public Iterator<DataRelation> iterator()
Returns: java.util.Iterator<com.groupdocs.assembly.system.data.DataRelation>
public int getCount()
Returns: int - the total number of elements in a collection
public boolean contains(DataRelation relation)
Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| relation | DataRelation | The name of the relation to find. |
Returns: boolean - true, if a relation with the specified name exists; otherwise false.
public int indexOf(DataRelation relation)
Returns the index of the specified relation within this collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| relation | DataRelation | A relation to find. |
Returns: int - The zero-based index of the specified relation, or -1 if the relation does not exist in this collection.
public DataRelation get(String name)
Gets the relationship by its name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | the name of relationship |
Returns:
DataRelation - DataRelationship or null
public DataRelation get(int index)
Gets a DataRelation instance from the collection at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The zero-based index of the relation to return. |
Returns: DataRelation - A DataRelation instance from the collection at the specified index.
public void removeAt(int index)
Removes the relation at the specified index from the collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | The index of the relation to remove. |
public void clear()
Clears the collection of any relations.
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.