Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOF Tools and Techniques

Table of Contents Previous Section

Creating Relationships

If the database on which your model is based includes definitions for foreign keys, these definitions will automatically be expressed in your model as ready-made relationships.

You can also explicitly form a relationship between entities if one doesn't already exist. This relationship must reflect an actual relationship between the entities' corresponding tables in the database.

Forming a relationship allows you to access data in a destination table that relates to data in a source table (it's also possible to have a reflexive relationship, in which the source and destination tables are the same). For example, to find all of the roles in a particular movie, you can form a relationship between the MovieRole and Movie entities.

EOModeler provides two mechanisms for forming relationships. You can form them in the Model Editor's diagram view or in the Relationship Inspector. Using the diagram is the quickest way to create a new relationship, but using the Relationship Inspector gives you access to more relationship characteristics. Each mechanism is discussed in the following sections.

Table of Contents Next Section