Information Technology Reference
In-Depth Information
standalone (nonparticipating) child relation tuples, they can only be converted into
child element instances under an empty parent element instance.
Case 1: Total/Mandatory Participation (Fig. 4.14 )
RelationA
A1
a11
a12
XMLDocument
A2
a21
a22
<A A1="a11" A2="a21">
<B B1="b11" B2="b21"></B>
</A>
Data
Relation B
B1
b11
Conversion
<A A1="a12" A2="a22">
<B B1="b12" B2="b22"></B>
<B B1="b13" B2="b23"></B>
</A>
B2
b21
*A1
a11
b12
b22
a12
b13
b23
a12
Fig. 4.14 Total participation: data conversion
Case 2: Partial/Optional Participation (Fig. 4.15 )
Relation A
A1
a11
a12
A2
a21
a22
XMLDocument
Data
<A A1="a11" A2="a21">
<B B1="b11" B2="b21"></B>
</A>
Relation B
B1
b11
Conversion
B2
b21
*A1
a11
<A A1="a12" A2="a22"></A>
b12
b22
null
<A></A>
<B B1=“b12” B2=“b22”></B>
Fig. 4.15 Partial participation: data conversion
Rule 3: Mapping Cardinality from RDB to XML
In converting one-to-one relational tuples into XML instances, we must ensure
that each parent element instance consists of one child element instance only. In
converting one-to-many relational tuples into XML instances, each parent element
instance can have multiple child element instances. In converting many-to-many
relational tuples into XML instances, a pair of ID and IDREF in two element types
are applied such that they refer to each other in many-to-many associations.
Search WWH ::




Custom Search