Previous Next

Forming Relationships in the Inspector

Creating relationships in the Relationship Inspector is a more manual process than creating one in the diagram view. The inspector provides only the ability to configure a relationship that already exists. So before you can edit a relationship in the Relationship Inspector, you must add a relationship to an entity.

Assuming that the entities in the previous example exist (Person and PersonPhoto), you can form a relationship between them by selecting an entity (Person) and then choosing Add Relationship from the Property menu. Then, select the new relationship in the tree view by clicking the plus sign next to an entity and open the Relationship Inspector by choosing Inspector from the Tools menu.

Now you can use the Relationship Inspector to configure the relationship. Follow these steps and refer to Figure 5-6 for clarity:

  1. In the Relationship Inspector, select the destination entity (PersonPhoto) from the Entity list in the Destination box.
  2. Select the source attribute (personPhotoID) in the Source Attributes list.
  3. Select the destination attribute (personPhotoID) in the Destination Attributes list.
  4. Make sure the relationship has the proper cardinality, To One in this case.
  5. Click Connect.

Figure 5-6 Using the Relationship Inspector to build a relationship

[image: ../Art/personphotoininspector.gif]

EOModeler assigns the relationship a default name based on the name of the destination entity and the cardinality of the relationship. You can edit this name using the Relationship Inspector or in table mode.

The source and destination attributes you chose are based on general rules for relationships, which are described in “Relationship Keys”.




Previous Next


© 2002 Apple Computer, Inc. (Last Updated November 2002)