An Association Set groups Association instances (similar to how an Entity Set groups Entity Type instances). Hence, it specifies a relationship between two Entity Sets based on the respective Entity Types of the underlying Association.
Assuming you have a 1:n association Author_To_Books based on Entity Types Author and Book there may be an Association Set WrittenBy for the Entity Sets Authors and Books, as well as another Association Set FictionWrittenBy for the Entity Sets FictionAuthors and FictionBooks. This means if you follow a navigation link from an entry of an Authors feed at runtime, it yields a Books feed, whereas following a link from an entry of the FictionAuthors feed yields a FictionBooks feed – both are structurally equal (being based on the same Entity Types) but have different semantics and may contain different entries.
To create an Association Set in the Service Builder proceed as follows:
Right click the Data Model folder, and click Create, and then select Association Set. Also, you can create a new Association Set when you right click the Association Set folder, and choose Create. Create Association Set dialog opens.
Specify a name for the Association Set.
The Association Set name must be unique, and cannot contain characters that are not allowed such as, numbers and other symbols. All the elements needed to create relations between entities, such as Association, Association Set, Referential Constraints, and Navigation Properties are also created for you. Press F4 in Association Name to choose from the list of associations in the model. The Association Set and Navigation Properties must be unique. The cardinality for the Entity Type and Entity Set are automatically verified.
When you choose OK, a new Association Set is created in the project tree.
In the mass edit view, the Association Set table displays the new entries for the Association Set.
Alternatively, use the following steps:
Open Service Builder.
Expand the Data Model folder in the tree view of your project.
Double-click the Association Set folder to open it in the mass edit view.
Click and then to create a new association.
A row is now added.
Do the following in the mass edit view under Association Sets :
Fields |
Description |
---|---|
Name |
Enter a name in the Association Set Name field. |
Association |
Enter the association name in the Association Name field. |
Principal Entity Set Name |
Enter the name of the Principal Entity Set for which the association set has to be created. |
Dependent Entity Set Name |
Enter the name of the Dependent Entity Set for which the association set has to be created. |
Label |
Enter a label for the new association. |
Label Text Reference Editor |
To define the label, use the Label Text Reference Editor. The Label Text Reference Editor enables you to enter the reference type. |
Save the changes.
See Associations for more information about additional options.