JBoss.orgCommunity Documentation

Chapter 12. Relationships

12.1. Creating Relationships
12.2. Creating your own Relationship Type
12.3. Relationship Navigator


The Teiid Designer includes the ability to create named relationships between almost any two or more modeling elements.

The Relationship metamodel is one way to define arbitrary associations between two or more metadata entities. Using the Relationship metamodel, the Teiid Designer provides users the ability to view, add, and edit associations between metadata entities.

But the Generic Relationships functionality can define relationships between metadata entities from different metamodels. For example, it is possible to create a generalized relationship between a Relational Column and a UML Package.

Users can even define their own Section 12.2, “Creating your own Relationship Type” that constrain the numbers and types (metaclasses) of objects that can be related.

Once the existing relationships are defined, the Teiid Designer provides a number of mechanisms that will make use of those relationships. This includes navigating to a related object, searching for relationships based on some criteria, or diagramming the relationship of various sets of objects

To create a relationship from the Section 4.1, “Model Explorer View” tree, select two or more objects in the tree, right-click select New Association > Relationship action and follow Steps 3 through 8 described above.

A Relationship Navigator view provides a unique way of viewing and navigating your relationships. It can be very useful in understanding associations between complex and visibly unrelated data.

To open the Relationship Navigator you can select the Window > Show View > Relationship Navigator action (if available) or open the Show View dialog via Window > Show View > Other... and open the Teiid Designer folder and select Relationship Navigator .

You can also quick-launch the navigator by selecting any object in the Section 4.1, “Model Explorer View” or a Model Editor and right-click select the Modeling > Open in Relationship Navigator action.

In the example presented here, the diagram below illustrates the standard role-based relationships defined for a family.

This action opens the Relationship Navigator in the same panel as the Properties and Description views.

The visible detail in the navigator is limited in order to simply navigation. You can, however, show detailed information about the navigation/relationship nodes by hovering your mouse and showing tooltips.

At the center of the navigator is the focused node, which represents the base or frame of reference for the displayed navigation. In this sample above, George has a wife, a niece and 5 sons. The relationship diagram shown below illustrates the role based view of these same relationships.

You can navigate to through your relationships by double-clicking an end-node in one of the relationships. For instance, double-click the Son Ron in the upper end-node and the navigator now focuses on Ron and his relationships. You can also right-click and select the Follow Relationships action.

As you navigate, a blue ball will animate the direction of the relationship flow first too the focused object then into the end of the relationship containing the initial focused object.

The navigator also provides toolbar and right-click menu actions to perform various functions in the navigator.