ER/Studio - Embarcadero Technologies Product Documentation
ER/Studio - Embarcadero Technologies Product Documentation ER/Studio - Embarcadero Technologies Product Documentation
USING ER/STUDIO > DEVELOPING THE LOGICAL MODEL Creating and Editing Relationships Creating and Editing Recursive Relationships A recursive relationship associates an object with itself; the object is both the parent and child. For example, you can have an employee who manages many employees and each employee is managed by one employee. The employee entity has a recursive relationship to itself. If you have a recursive relationship, you must assign rolenames to the relationship. Use the Recursive Relationship dialog to specify rolenames for a foreign key that is inherited more than once within the same entity. For example, if a recursive relationship is created where one entity is designated as both the parent and child entity, then the primary key is propagated within the entity. ER/Studio automatically opens the Recursive Relationship dialog box when it detects overlapping foreign keys in an entity. The steps for adding recursive relationships are slightly different from adding regular relationships; however, you can for edit and delete recursive relationships in the same manner as for regular relationships. 1 Click Insert > Insert Relationship, and then select a non-identifying relationship type. 2 On the Data Model Window, click the object to which you want to apply the recursive relationship, and then click it again. 3 Complete the Recursive Relationship or Recursive Relationship for Multiple Keys dialog box, and then click OK. 4 Right click anywhere on the Data Model to revert to the Selection tool. Notes • If you have a recursive relationship, the Recursive Relationship editor appears where you must assign a rolename to the primary key or to at least one attribute of the primary key. The rolename cannot be the same as the attribute or column name. In order for the foreign key to appear in the child, it must be assigned a rolename so it can be differentiated it from the native key. • If you have a recursive relationship where multiple foreign keys that are inherited more than once within the same entity, the Recursive Relationship for Multiple Keys dialog display where you specify rolenames for each foreign keys. For example, if a recursive relationship is created, where one entity is designated as both the parent and child entity, then the primary keys are propagated within the entity. • Edit the rolenames associated with the relationship by right-clicking the relationship in the Data Model Window, and then selecting Edit Rolenames. • Navigate between the parent and child object by right-clicking the object and then selecting Navigate to Parent or Navigate to Child from the shortcut menu. Creating View Relationships The steps to adding and deleting view relationships are the same as those of regular relationships. However, view relationships are a special type of relationship used to propagate attributes from an entity or a view to a view. When adding a view relationship, the end point of the relationship must be a view. View relationships cannot be edited, but they can be deleted. To determine which attributes of an entity can be propagated from the parent entity or view to the child view, use the View Editor - Column Tab. NOTE: In order for view relationships to display, you must enable the options to display views and view relationships on the View tab of the Diagram and Object Display Options dialog. Click View > Diagram and Object Display Options. EMBARCADERO TECHNOLOGIES > ER/STUDIO® 8.0.3 USER GUIDE 136
USING ER/STUDIO > DEVELOPING THE LOGICAL MODEL See Also Creating and Editing Data Base Views Creating Subtype Cluster Relationships NOTE: Subtype cluster relationships can only be represented in the logical model. When the physical model is generated from a logical model, the subtype relationship is converted to identifying relationship. A subtype cluster refers to a group of entities sharing similar characteristics that form a generalization hierarchy. In each subtype cluster, there is one parent entity, known as a supertype, and one or more subtype entities. The supertype generalizes a set of subtypes; the common characteristics of subtype entities are assigned to the supertype while the subtype entities have more specific attributes. The subtypes, also known as category entities, represent homogeneous subsets of the supertype. The attributes and relationships of the supertype entity are propagated to all of its subtypes. Discriminators, an attribute of the subtype, distinguish the entities in the subtype from each other. Other than recognizing a generalization hierarchy, an important issue with subtyping is to decide how to implement a subtype cluster in the physical model. Sometimes it is best to project subtypes into the supertype, representing the entire cluster as a single, generalized entity. Other times, you may need the granularity of separate subtype entities, choosing to implement the subtypes and supertype one-for-one or rolling the supertype down into the subtypes. During the logical model phase, you should search for hierarchies that can reveal a more general approach to aggregating attributes into entities. By addressing the general case, you can design a more flexible and extensible approach to storing data. The use of subtyping is a powerful tool in identifying and portraying such generalizations. EMBARCADERO TECHNOLOGIES > ER/STUDIO® 8.0.3 USER GUIDE 137
- Page 85 and 86: USING ER/STUDIO > COMMON TASKS Asso
- Page 87 and 88: USING ER/STUDIO > COMMON TASKS Comp
- Page 89 and 90: USING ER/STUDIO > COMMON TASKS Dime
- Page 91 and 92: USING ER/STUDIO > COMMON TASKS •
- Page 93 and 94: USING ER/STUDIO > COMMON TASKS See
- Page 95 and 96: USING ER/STUDIO > COMMON TASKS The
- Page 97 and 98: USING ER/STUDIO > COMMON TASKS The
- Page 99 and 100: USING ER/STUDIO > COMMON TASKS •
- Page 101 and 102: USING ER/STUDIO > COMMON TASKS 3 In
- Page 103 and 104: USING ER/STUDIO > COMMON TASKS Chan
- Page 105 and 106: USING ER/STUDIO > COMMON TASKS •
- Page 107 and 108: USING ER/STUDIO > COMMON TASKS Shap
- Page 109 and 110: USING ER/STUDIO > COMMON TASKS Addi
- Page 111 and 112: USING ER/STUDIO > DEVELOPING THE LO
- Page 113 and 114: USING ER/STUDIO > DEVELOPING THE LO
- Page 115 and 116: USING ER/STUDIO > DEVELOPING THE LO
- Page 117 and 118: USING ER/STUDIO > DEVELOPING THE LO
- Page 119 and 120: USING ER/STUDIO > DEVELOPING THE LO
- Page 121 and 122: USING ER/STUDIO > DEVELOPING THE LO
- Page 123 and 124: USING ER/STUDIO > DEVELOPING THE LO
- Page 125 and 126: USING ER/STUDIO > DEVELOPING THE LO
- Page 127 and 128: USING ER/STUDIO > DEVELOPING THE LO
- Page 129 and 130: USING ER/STUDIO > DEVELOPING THE LO
- Page 131 and 132: USING ER/STUDIO > DEVELOPING THE LO
- Page 133 and 134: USING ER/STUDIO > DEVELOPING THE LO
- Page 135: USING ER/STUDIO > DEVELOPING THE LO
- Page 139 and 140: USING ER/STUDIO > DEVELOPING THE LO
- Page 141 and 142: USING ER/STUDIO > DEVELOPING THE LO
- Page 143 and 144: USING ER/STUDIO > DEVELOPING THE PH
- Page 145 and 146: USING ER/STUDIO > DEVELOPING THE PH
- Page 147 and 148: USING ER/STUDIO > DEVELOPING THE PH
- Page 149 and 150: USING ER/STUDIO > DEVELOPING THE PH
- Page 151 and 152: USING ER/STUDIO > DEVELOPING THE PH
- Page 153 and 154: USING ER/STUDIO > DEVELOPING THE PH
- Page 155 and 156: USING ER/STUDIO > DEVELOPING THE PH
- Page 157 and 158: USING ER/STUDIO > DEVELOPING THE PH
- Page 159 and 160: USING ER/STUDIO > DEVELOPING THE PH
- Page 161 and 162: USING ER/STUDIO > DEVELOPING THE PH
- Page 163 and 164: USING ER/STUDIO > DEVELOPING THE PH
- Page 165 and 166: USING ER/STUDIO > DEVELOPING THE PH
- Page 167 and 168: USING ER/STUDIO > DEVELOPING THE PH
- Page 169 and 170: USING ER/STUDIO > DEVELOPING THE PH
- Page 171 and 172: USING ER/STUDIO > DEVELOPING THE PH
- Page 173 and 174: USING ER/STUDIO > DEVELOPING THE PH
- Page 175 and 176: USING ER/STUDIO > DEVELOPING THE PH
- Page 177 and 178: USING ER/STUDIO > DEVELOPING THE PH
- Page 179 and 180: USING ER/STUDIO > DEVELOPING THE PH
- Page 181 and 182: USING ER/STUDIO > DEVELOPING THE PH
- Page 183 and 184: USING ER/STUDIO > DEVELOPING THE PH
- Page 185 and 186: USING ER/STUDIO > DEVELOPING THE PH
USING <strong>ER</strong>/STUDIO > DEVELOPING THE LOGICAL MODEL<br />
Creating and Editing Relationships<br />
Creating and Editing Recursive Relationships<br />
A recursive relationship associates an object with itself; the object is both the parent and child. For example, you can<br />
have an employee who manages many employees and each employee is managed by one employee. The employee<br />
entity has a recursive relationship to itself.<br />
If you have a recursive relationship, you must assign rolenames to the relationship. Use the Recursive Relationship<br />
dialog to specify rolenames for a foreign key that is inherited more than once within the same entity. For example, if a<br />
recursive relationship is created where one entity is designated as both the parent and child entity, then the primary<br />
key is propagated within the entity. <strong>ER</strong>/<strong>Studio</strong> automatically opens the Recursive Relationship dialog box when it<br />
detects overlapping foreign keys in an entity.<br />
The steps for adding recursive relationships are slightly different from adding regular relationships; however, you can<br />
for edit and delete recursive relationships in the same manner as for regular relationships.<br />
1 Click Insert > Insert Relationship, and then select a non-identifying relationship type.<br />
2 On the Data Model Window, click the object to which you want to apply the recursive relationship, and then click<br />
it again.<br />
3 Complete the Recursive Relationship or Recursive Relationship for Multiple Keys dialog box, and then click<br />
OK.<br />
4 Right click anywhere on the Data Model to revert to the Selection tool.<br />
Notes<br />
• If you have a recursive relationship, the Recursive Relationship editor appears where you must assign a<br />
rolename to the primary key or to at least one attribute of the primary key. The rolename cannot be the same as<br />
the attribute or column name. In order for the foreign key to appear in the child, it must be assigned a rolename<br />
so it can be differentiated it from the native key.<br />
• If you have a recursive relationship where multiple foreign keys that are inherited more than once within the same<br />
entity, the Recursive Relationship for Multiple Keys dialog display where you specify rolenames for each foreign<br />
keys. For example, if a recursive relationship is created, where one entity is designated as both the parent and<br />
child entity, then the primary keys are propagated within the entity.<br />
• Edit the rolenames associated with the relationship by right-clicking the relationship in the Data Model Window,<br />
and then selecting Edit Rolenames.<br />
• Navigate between the parent and child object by right-clicking the object and then selecting Navigate to Parent or<br />
Navigate to Child from the shortcut menu.<br />
Creating View Relationships<br />
The steps to adding and deleting view relationships are the same as those of regular relationships. However, view<br />
relationships are a special type of relationship used to propagate attributes from an entity or a view to a view. When<br />
adding a view relationship, the end point of the relationship must be a view. View relationships cannot be edited, but<br />
they can be deleted. To determine which attributes of an entity can be propagated from the parent entity or view to the<br />
child view, use the View Editor - Column Tab.<br />
NOTE: In order for view relationships to display, you must enable the options to display views and view<br />
relationships on the View tab of the Diagram and Object Display Options dialog. Click View ><br />
Diagram and Object Display Options.<br />
EMBARCAD<strong>ER</strong>O TECHNOLOGIES > <strong>ER</strong>/STUDIO® 8.0.3 US<strong>ER</strong> GUIDE 136