DataRelationCollection

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.

Methods

Method Description
add(DataRelation relation) Adds a relation to the collection.
add(DataTable parentTable, DataTable childTable, String parentColumnName, String childColumnName) Adds a relation to the collection.
add(DataTable parentTable, DataTable childTable, String[] parentColumnNames, String[] childColumnNames) Adds a relation to the collection.
add(String name, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)
add(DataColumn parentColumn, DataColumn childColumn)
add(String name, DataColumn parentColumn, DataColumn childColumn)
iterator()
getCount()
contains(DataRelation relation) Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection.
indexOf(DataRelation relation) Returns the index of the specified relation within this collection.
get(String name) Gets the relationship by its name.
get(int index) Gets a DataRelation instance from the collection at the specified index.
removeAt(int index) Removes the relation at the specified index from the collection.
clear() Clears the collection of any relations.

add(DataRelation relation)

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.

add(DataTable parentTable, DataTable childTable, String parentColumnName, String childColumnName)

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.

add(String name, DataColumn parentColumn, DataColumn childColumn, boolean createConstraints)

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

add(DataColumn parentColumn, DataColumn childColumn)

public void add(DataColumn parentColumn, DataColumn childColumn)

Parameters:

Parameter Type Description
parentColumn DataColumn
childColumn DataColumn

add(String name, DataColumn parentColumn, DataColumn childColumn)

public void add(String name, DataColumn parentColumn, DataColumn childColumn)

Parameters:

Parameter Type Description
name java.lang.String
parentColumn DataColumn
childColumn DataColumn

iterator()

public Iterator<DataRelation> iterator()

Returns: java.util.Iterator<com.groupdocs.assembly.system.data.DataRelation>

getCount()

public int getCount()

Returns: int - the total number of elements in a collection

contains(DataRelation relation)

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.

indexOf(DataRelation relation)

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.

get(String name)

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

get(int index)

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.

removeAt(int 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.

clear()

public void clear()

Clears the collection of any relations.