This series is a commentary of sorts on a PowerPoint™ presentation called Nordic – Object Relational Database Design. The previous posts are at
- Nordic (1) (Establish the Oracle Environment, and Basic Object Model)
- Nordic (2) (First version of type physical design)
- Nordic (3) (Persistent storage and type dependencies)
- Nordic (4) (Associations)
- Nordic (5) (Associations)
- Nordic (6) (Associations)
- Nordic (7) (Physical design scripts)
- Nordic (8) (Object state)
We have completed a physical design that includes the state class, ANIMAL_STATE. Now we move onto slide #34 of the presentation.
The following table attempts to map attributes listed on slide #34 of the presentation against columns from Oracle Data Dictionary views. These examples are for the ANIMAL type.
|Data Dictionary View||Column|
|ObjectID (GUID)||OBJECT_ID pseudo-column.|
|Workflow State||Not implemented|
|Primary Date||Not explained in presentation.|
|Owner Object||Username used to connect to Oracle instance.|
|Language Object||Set for the session when one connects to the Oracle instance.|
|Locked (Frozen)||Not implemented|
We are now at slide #36 of the presentation.
To insert a new object, we would use the INSERT command to achieve this in conjunction with the object constructor.
INSERT INTO animals VALUES( NEW horse( 'Phar Lap', NEW animal_state( 'Deceased' ) ) );
To delete an object, we would use the DELETE command to achieve this.
DELETE FROM animals WHERE name = 'Phar Lap';
UPDATE animals ptr SET object_value = NEW girl( name, NEW human_state( ptr.current_state.state ) ) WHERE name = 'Mabel';
To modify a class definition, we would use the ALTER TYPE command with the CASCADE option:
ALTER TYPE animal ADD ATTRIBUTE nonsense NUMBER CASCADE;
To change an attribute of an object, we would use the UPDATE command:
UPDATE animals SET state = NEW animal_state( 'Ill' ) WHERE name = 'Mabel';
To associate one object with another object, we would use the INSERT command to place a row in a an association table:
INSERT INTO courtships VALUES( 'Billy Joe', 'Mary Lou' );
To remove an association between two objects, we would use the DELETE command to achieve this.
DELETE FROM courtships WHERE guy_name = 'Billy Joe' AND girl_name = 'Mary Lou';
Object Facade: Searching
We are now at slide #37 of the presentation.
Since each base class is persisted to a different table, and we have used the NAME column as the primary key for some of these columns, we can easily identify objects by table name and primary key.
SELECT object_id FROM animals WHERE name = 'Mabel';
See previous item.
Object Facade: Cascade Class Retrieval
We are now at slides #38 and #39.
The physically implementation we have done so far has been a single table. In Nordic, the persistent storage is vertically partitioned. This is not the case in our implementation.
We are now at slides #42 to #56 (inclusive).
This topic has been done to death in previous articles in this series.
Slides #54 and #55 are not clear without the narration. I will not comment further.