Using TargetObjectCol with Relationship Collections
The TargetObjectCol class provides a convenient way to manipulate relationship collections. When you manipulate a target object collection, you actually manipulate the corresponding relationship collection.
For example, suppose you are manipulating the target object collection describing the employees managed by Frank, shown in the following figure.
Now suppose you want to add Louise, an existing employee, to the collection. To do so, use the Add method, extending the collection to look like the collection in the following figure.
When you call the Add method, the repository engine actually adds a relationship to the corresponding relationship collection. Before adding the new relationship, the relationship collection appeared as follows.
Using the Add method changed the relationship collection to the following.