To flatten an attribute:
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
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
If you select the flattened attribute and display the Attribute Inspector, youll 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 attributes name in the inspector.
Figure 4-8 A flattened attribute in the Attribute Inspector