5.1 Theoretical Background
It is clear that ORDBMS consists of some object-relational concepts. Therefore it is best to use EERD or UML class diagram in order to develop an object-relational data model
since both diagrams covers a lot of object-relational features.
However, it is not wrong to use other models like ERD or object-based data model for the same purpose. In this practical, UML class diagram will be used since it allow us to
translate more of the real-world structure into the database schema. Students will learn how to transform it into an object-relational data model based on some rules and
guidelines for modelschema transformation originated from relational data model transformation rules.
Table 5-1 consists of rules as guidelines for schema transformation from conceptual design using UML terminology to object-relational design using SQL3 a generic
database language and Oracle9i a specific DBMS terminology.
Table 5-1 : Schema transformation terminology
UML class diagram SQL3
Oracle 9i Class
Class Extension Structured Type
Typed Table Object Type
Table of Object Type
Attribute Multivalued
Composed Calculated
Attribute ARRAY
ROWStructured Type in column TriggerMethod
Attribute VARRAY
Object Type in column TriggerMethod
Association One-To-One
One-To-Many Many-To-Many
Relationship REFREF
REFARRAY ARRAYARRAY
Relationship REFREF
REFNested Table Nested TableNested Table
Composition ARRAY
Nested Table Inheritance
Generalization TypesTyped Tables
Subtypes
29
Section 5.2 Step-by-step shows how mapping of a UML class diagram to an object- relational data model using Oracle9i terminology is performed. Assume that a complete
UML class diagram is the one shown in Figure 5-1.
+personId : String +personName : Name
+personAddress : Address +phoneNumber : String
+birthDate : Date
Person
+firstName : String +midName : String
-lastName : String
Name
+street : String +city : String
-state : String +poscode : String
Address
-Has 1
-refers_to 1
-lives_at 1
-belongs_to 1
-employeeId : String -startDate : Date
Employee
-customerId : String
Customer
-DependantId : String -DependantName : Name
-DependantAddress : Address
Dependant
-Has 1
-isDependantOf -isAdvisedBy
1 -seekAdviseFrom
0..
{optional,disjoint}
-Has 1
-refersTo 1
-livesAt 1
-belongsTo 1
Figure 5-1: A UML class diagram
30
5.2 Step-by-step