Previous Next

Flattening an Attribute

To flatten an attribute:

  1. In browser mode, select the entity in which you want the flattened attribute to appear and select the relationship whose destination entity holds the attribute you want to flatten.

    For example, in the Real Estate model, to flatten the photo attribute from the PersonPhoto entity into the Person entity, select the Person entity and select the personPhoto relationship, as shown in Figure 4-6.

    Figure 4-6 Selecting the relationship in which the attribute to flatten exists

    [image: ../Art/flatten_select_relation.gif]
  2. Select the attribute in the destination entity (photo ) for which you want to create the flattened attribute and choose Flatten Property from the Property menu.

    The flattened attribute appears in the list of properties for the Person entity as personPhoto_photo, as shown in Figure 4-7. The format of the name reflects the traversal path: the attribute photo is added to the Person entity by traversing the personPhoto relationship.

    Figure 4-7 An attribute flattened

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

If you select the flattened attribute and display the Attribute Inspector, you’ll see that the attribute is considered derived and its definition is a key path, as shown in Figure 4-8. Just as with other types of attributes, you can edit the flattened attribute’s name in the inspector.

Figure 4-8 A flattened attribute in the Attribute Inspector

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

Previous Next


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