In the Data Model Entities
panel, right-click the element you want to set as a foreign key and select
Set the Foreign Key from the contextual
In this example, right-click the Director attribute from the Movie entity.
The Set the Foreign Key dialog
box pops up.
Note that a Foreign Key must always be a string.
Click the [...] button to open
the [Select Xpath] dialog box.
Browse to the Director attribute
Id and then click Add in the bottom of the dialog box.
The Xpath to the foreign key is displayed in the Set the Foreign Key dialog box.
Click OK to finish setting the
The foreign key is set to Director/Id under the Annotations node of the Director attribute in the Movie entity.
Follow the same steps to set the Movie attribute in the Customer entity as a foreign key which points to the Movie entity.
In the Movie data model, the foreign
keys are added to link entities in the data model.