Defining foreign keys to link entities in a data model - 7.3

Talend MDM Platform Getting Started Guide

EnrichVersion
7.3
EnrichProdName
Talend MDM Platform
EnrichPlatform
Talend Administration Center
Talend DQ Portal
Talend Installer
Talend MDM Server
Talend MDM Web UI
Talend Runtime
Talend Studio
task
Data Quality and Preparation > Cleansing data
Data Quality and Preparation > Profiling data
Design and Development
Installation and Upgrade
The following procedure shows how to define foreign keys to link entities created in Creating business entities in the data model in the Movie data model.

Procedure

  1. 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 menu.

    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.

  2. Click the [...] button to open the Select Xpath dialog box.
  3. 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.

  4. Click OK to finish setting the foreign key.

    The foreign key is set to Director/Id under the Annotations node of the Director attribute in the Movie entity.

  5. Follow the same steps to set the Movie attribute in the Customer entity as a foreign key which points to the Movie entity.

Results

In the Movie data model, the foreign keys are added to link entities in the data model. You can also click the Design tab to view the relationships between entities in a data model in a graphical designer. For more information, see Talend Studio User Guide.