Associations of Views¶
Let us imagine we have a view with customers and another view with orders. We can assume they are related to each other: one order is related to one and only one customer, whereas a customer may be related to zero, one or many orders. This kind of relationships are represented in Virtual DataPort using associations.
An association establishes a relationship between two views. To be more specific, an association is defined as a pair of endpoints, where each endpoint consists of:
The role played by the other entity from the point of view of this endpoint.
The multiplicity, i.e., how many members of the view participate in the relationship.
In addition, you can mark one endpoint in the association as principal and the other as dependent, since one entity may need the other one to exist. In our example, an order only exists if there is a customer, but not the other way around.
Therefore, we can express the relationship between customer and order with the following endpoints:
Find more details on associations in the Virtual DataPort Administration Guide.
As we have already seen, associations between views are useful when building and executing queries on a view, since they allow you to navigate through its relationships and retrieve not only the tuples of the current view, but the tuples of its related views. They are also useful for discovering new views. You can start from a view you are familiar with and discover those views related to it, which may be of interest to you.
The Relationships tab displays a graph where you can check all the related views to the current view. You can zoom in, zoom out or export the graph as an image.
The views are represented as nodes in the graph. The node for the current view is always highlighted in orange. In case a related view belongs to a different database, its name will be highlighted in orange. You can move your mouse over the icon of a node and a tooltip will appear with information about its view. Click the icon in the tooltip to get even more information.
The arrows in the graph represent a relationship between the two views it connects. Notice that the arrows start from the principal endpoint and end in the dependent one. If you move your mouse over an arrow, a tooltip will appear with information about the role and multiplicity of each endpoint. Click the icon to get more information about one endpoint or click the icon to get more information about the association.