An association represents a relationship between two views. It is defined by two endpoints and a list of mappings. Each endpoint is associated with a view and has a “role name”, a description and a multiplicity. The list of mappings defines the relation between the fields of the two views and allows traversing the association. A mapping is defined by a pair of expressions, each one expressed over the fields of one of the views.
Optionally, you can mark the association as a Referential constraint and set a Role precondition. When you define an association as a referential constraint, the association is considered a foreign key constraint.
For example, the
customer view can be linked with the
with cardinality *. This means that every customer is related with zero
or more orders.
In a way, an association is like a join view because it links two views.
At runtime, users can navigate through associations using navigational
SELECT_NAVIGATIONAL) or the RESTful Web service. In order
to navigate through the associations of a view, the view must have
primary key. See more about navigational queries in the section Navigational Queries of the VQL Guide.