7.      Via the ‘Attributes’ tab, add Student Enrollment Type to the identifier. Click <OK> to save the changes to the Identifier. The symbol for Student Enrollment Type will change to reflect the new identifier; again, this is not a primary identifier, but we’ll soon change that. The property sheet for the entity will still be open – in the ‘Identifiers’ tab, the P column has not been selected (see Figure 14.15), telling us that this is not the primary identifier.

Figure 14.15 The empty ‘P’

8.      To convert the identifier into a primary identifier, select P in the ‘Identifiers’ tab, then click on <OK> or <Apply>. In the diagram, notice the changes that have been made to Student Enrollment Type and Student. The attribute Student Enrollment Type has been migrated to Student.

There is a quicker way to create a primary identifier, via the ‘Attributes’ tab on the Entity Property Sheet. In the ‘Attributes’ tab, the P column indicates whether or not an attribute is part of the primary identifier. In Figure 14.16, we can see that Student Enrollment Type is part of the primary identifier.

Figure 14.16 The P column for attributes

If you were to de-select column P, the attribute would be removed from the primary identifier, and the primary identifier would still exist. Re-select P and the attribute will again be included in the primary identifier. We can take advantage of this behavior to create the primary identifier with just a single mouse-click.

YOUR TURN TO PLAY

Open the property sheet for the entity Class; in the ‘Attributes’ tab, select column P for the attribute Class Full Name. Notice that the M (mandatory) column is automatically selected as well – attributes in the primary identifier are mandatory. Switch to the ‘Identifiers’ tab, and you’ll see that a primary identifier has been created, as shown in Figure 14.17.

Figure 14.17 Making Class Full Name part of the primary identifier

14.17.emf

Look at the diagram fragment in Figure 14.18, and you’ll see the changes that have been made - each change has been circled on the diagram. The Class entity now has a primary identifier, the attribute Class Full Name is now flagged as <pi>, and the format of the name has changed accordingly. The attribute Class Full Name has been migrated to the entity Attendance.

Figure 14.18 The revised diagram

14.18.emf

Do not use this method to convert an existing candidate identifier into a primary identifier. If the entity does not have a primary identifier already, selecting the P column for any attribute will always create a new identifier.

The new Class Full Name attribute is, of course, dependent upon the original attribute in Class. This dependency is visible in the property sheet for both of the Class Full Name attributes; just open the property sheet for either attribute, and look at the ‘Dependencies’ tab. The original attribute will have a sub-tab called Primary Relationship Joins, and the migrated attribute will have a sub-tab called Foreign Relationship Joins. Both sub-tabs contain a link to the relationship that joins them. Figure 14.19 shows the sub-tab on the migrated attribute.

Figure 14.19 The attribute depends on a relationship

14.19.emf

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset