0779-0781

Previous Table of Contents Next

Page 779

You can use the Autolayout function (from the toolbar), which consolidates any existing entities with the new entities and attempts to adhere to the standard conventions of relationships appearing from bottom-right to top-left. In this convention, the tangible objects in your systems such as people, places, and things appear in the bottom-right corner and the intangible objects such as invoices, purchase orders, and so on appear in the upper-left corner.

TIP
To select multiple entities from the include list, hold down the Ctrl key and click the entities you require, or select a block of entities by holding down the Shift key. If you choose a large number, your diagram might become too difficult to follow for the initial editing ”so keep this in mind when you make your selection.
Editing Attributes

You can add a great deal of information about attributes in the Entities properties screen. Just double-click the entity and go to the Attributes Detail tab. Here, you can add field type, length, primary key, domain, a comment (which is the basis for the database comment and hint), and optionality. Go to the Attribute Values tab, and you can add allowable values or an allowable range for an attribute.

TIP
If you are using domains, do not use the Attribute Values tables for allowable values or an allowable range. This information is contained within the domain.

Optionality defines whether the attribute is required in entity.

If you define an attribute as a primary key, a UID (unique identifier) is automatically created for that primary key. If you later attempt to delete the attribute that is a primary key, you must first delete the UID created and then the attribute itself.
Adding Relationships

Relationships are a means for connecting one entity to another and will eventually become foreign keys. After you have multiple entities on your diagram, you might want to show their relationships to one another. To do so, select one of the Relationship icons. Select a relationship. Then select the From entity. Next, select the To entity. When they are both selected, the system prompts you for the two relationship names. Then it places the relationship lines and the names on the diagram. There is a method to the readability of the relationship when viewed on the diagram. What you insert into the From and To boxes of the Relationship will eventually be read as the following:

Page 780

Each Entity 1 (may/must) be To Text of (one or more/one and only one) Entity 2.
Each Entity 2 (may/must) be From Text of (one or more/one and only one) Entity 1.

The degree of the relationship refers to whether each relationship end is the one or more or the one and only one. The one or more end will eventually contain the foreign key column derived from the primary key or primary key relationship of the joining table.

The transferable checkbox indicates whether the one and only one relationship end can be changed to another one and only one. For instance, if you identify an account as a savings account type, you probably would not want to switch that account to a checking account type. Therefore, the relationship is not transferable. On the ERD, the not transferable indicator is a diamond-shaped object on the relationship end.

CAUTION
Never create an attribute that is a foreign key. The Database Design Wizard will automatically create these columns when run.

If the relationship line does not come out straight, you can select just that line and autolayout to straighten the line. You can also bend the line at a 90-degree angle where you want it to bend; use the Shift key where the angle is to be created.

You may delete a relationship from the diagram without deleting it from the RON by cutting the relationship. If you choose to delete the relationship with the Delete key, you will be prompted and can delete it from the repository as well.

TIP
If you want to create more than one relationship without having to select the button each time, hold down the Shift key when you select the relationship button. When you are ready to move on to another activity, press another button on the icon bar.

If you set the property of including entities not to include relationships, you can include relationships from RON. To do so, choose Edit Include Relationships on the menu bar. Choose the relationship you want to include from the list, and it will appear on the diagram.

TIP
To select multiple relationships from the list, hold down the Ctrl key and click the relationships you require or select a block of relationships by holding down the Shift key. If you choose a large number, your diagram might become too difficult to follow for the initial editing, so keep this in mind when you make your selection.

Page 781

You might want to show an arc across multiple relationships. First, select each relationship in the arc by selecting one and then holding down the Ctrl key while selecting the others. The Create Arc icon becomes active. Click the Create Arc icon, and the arc will appear. To remove a relationship from an arc, click the arc and then hold down the Ctrl key while selecting the relationships to remove. Then the Remove from Arc icon becomes active. Click the Remove from Arc icon, and the relationships will be removed from the arc. If you want to add a relationship to the arc, click the relationship to add and hold down the Ctrl key while selecting the relationships to add. Then the Add to Arc icon will become active. Click the Add to Arc icon, and the relationships will be added to the arc.

Creating Subtypes and Supertypes

You might want to divide your entity into subtypes. To add a subtype inside an entity, create an entity and place your cursor inside the supertype when you place it on the diagram. You can also create subtypes and supertypes by dragging existing entities into the existing entity that will be the supertype .

Subtypes contain attributes that are unique to that subtype. The supertype includes the attributes that are common among all of its subtypes. Relationships may be made to a subtype or supertype, depending on the nature of the relationship.

NOTE
When you take a subtype out of a supertype, the ERD may not automatically display the entities appropriately. It is sometimes necessary to reinclude the entities in the ERD.
Using Domains

Domains are predetermined characteristics that attributes can inherit. For example, if the system contains several attributes that will eventually be represented as money, you can predefine the field length, decimal placement, and so on for these attributes. In the attributes property sheet, when you enter the domain, all the properties that are associated with that domain are automatically brought into the property sheet. The user is allowed to override the properties. Another good example is the usage of checkboxes. These can be yes/no or no/yes; the former has the default set to yes and the latter has the opposite default, no. For every attribute that would eventually become a checkbox with a yes/no response, you would associate the applicable domain depending on the default.

To create a domain, use Edit Domain from the menu bar. You will find a window in which you can define the attributes and allowable values of the domain. A domain cannot be depicted on an Entity Relationship Diagram as an entity, only as an attribute of an entity. In the attribute definition, the attribute can be linked to a domain.

Previous Table of Contents Next


Oracle Unleashed
Oracle Development Unleashed (3rd Edition)
ISBN: 0672315750
EAN: 2147483647
Year: 1997
Pages: 391

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net