OODB_Intro2.htm
 
The object oriented model should fulfill the following criteria's
  • Must support the modular complex objects.
  • Must be extensible or allow the new instance of the class as a new data type.
  • Support encapsulation, meaning the data and the method implementation only be allowed within the members or derived entities, and should be accessible to external entities.
  • The object must be able to inherit the properties (data and methods) of parent entities.
  • Each object would be distinct, segregated and accessible without any conflicting with other objects.
  • Objects should be capable of interacting with other objects.
OO Data Model Extended relational data model
Type Entity Definition
Class Entity
Object Entity Set
Instance variable Attribute
Not applicable Constraints with Key
OID NA
Method NA
Class Hierarchy Database Schema
In the scheme as shown below, instance of "fname" in Manager or Clerk or President in a subclass, maintains a class-to-subclass relationship. The president's or clerk's name will remain distinct, the name will provide an handle to fetch specific object who could be president or developer. Further, the attribute "admin"  would provide an handle to fetch an array of objects. Here "President", Manager" and "Clerk" all are grouped under the class employee, each has four implicit abstract data imposed by the Class.

 

The first step of object-relational environment requires defining collection of object types and methods. Once you define the object you can crate object tables.

Script

create or replace type objT1
( fname varchar(20), stdate date);
/

create table T1
(eno number(5),
fname varchar(20),
myvar objT1
);


SQl> desc objT1
 Will describe the table

Insert data with

insert into T1 (1, "Peter', objT1(' your comment', '1998-10-12' ));