Information Technology Reference
In-Depth Information
SELECT * from C
a1
where A
a1
= V
f1
into :
OID
C
a
1
…..
SELECT * from C
am
where A
am
= V
fm
into :
OID
C
am
Step 3. Insert the to-be-inserted object.
We can then put the OID of the composite objects (in step 2) into the aggregate
attributes of the to-be-inserted object and insert it as:
,16(57 LQWR &
N
$
«$
Q
3
F
«3
FP
` YDOXHV 9Y
«9Y
Q
2,'
&
D
«
2,'
&
DP
LQWR2,'
&N
1RWH 2,'
&
D
«
2,'
&
DP
H[LVW RQO\LI WKHUH DUH IRUHLJQNH\V LQWREH
LQVHUWHGWXSOH
Relational Operation Deletion
A simple delete statement in the object-oriented system corresponds to the relation-
al delete on the given relational schema. The transformation technique is to delete
a to-be-deleted object and remove, if any, the relationship that the to-be-deleted
object has with its composite objects as:
Algorithm Delete
Step 1. Locate the to-be-deleted object.
We can map a to-be-deleted tuple in relation R
k
to a corresponding to-be-deleted
object in class C
k
as:
64/'(/(7(IURP5
N
ZKHUHY
9Y
DQGY
9Y
«Y
Q
9Y
Q
3UHSURFHVVVFKHPDWUDQVODWLRQ5HODWLRQ5
N
Y
Y
«Y
Q
9
I
«9
IP
→
&ODVV&
N
$
$
«$
Q
3
F
«
3
FP
Step 2 (optional). Delete aggregate attribute of composite objects containing the
to-be-deleted object.
We can locate the parent relation R
p1
, R
p2
, … R
pm
of the relation R
k
of the to-
be-deleted tuple by matching its foreign keys V
f1
, V
f2
, … V
fm
against the parent
relations' primary keys. Similarly, there may be an aggregate attribute P
k
in the
to-be-deleted object that points to a set of associated class C
b1
, C
b2
, … C
bp
. We can
then delete the aggregate attribute of these composite objects in the associated class
C
a1
, C
a2
, … C
am
, C
b1
, C
b2
, … C
bp
.
Search WWH ::
Custom Search