08-05-05 12:45 PM
Hi Craig,
the different mappings strategies below make perfect sense. Also, the
strategy names are self-explanatory.
My understanding is that these strategy names correspond with attribute
names "serialized" and "embedded" of element <field>, respectively with
nested element <embedded>. Would it make sense to write up the
correspondence explicitly, e.g. assign strategies to each of the
examples in chapters 15.3, and 15.4.:
Example4: single-valued by reference.
Example5: multi-valued by reference to the primary table.
Example6: multi-valued by reference to the primary table.
Example7: multi-valued by reference to the primary table.
Example8: multi-valued by reference in a join table.
Example9: single-valued embedded (businessAddress, primaryAddress),
multi-valued embedded in a join table (secondaryAddresses).
Would it make sense to add examples for the remaining mapping strategies
"single valued serialized", "multi valued serialized", "multi valued
serialized in a join table"?
Regards,
Michael
> Javadogs,
>
> I'd like to add some text to the spec. This is intended to improve the
> basic description of mapping relationships.
>
> <spec 15.3>
> Mapping Strategies
> For single-valued relationships, there are three basic ways to map
> references from one persistence-capable class (the referring class) to a
> related class:
>
> serialized: The entire related instance is serialized into a single
> column in the primary or secondary table of the referring class.
>
> embedded: The related instance is mapped, field by field, to columns in
> the primary or secondary table of the referring class.
>
> by reference: The related instance is in a different table, and the
> column in the primary or secondary table of the referring class contains
> a reference (often, a foreign key) to the primary table of the related
> class.
>
> For multi-valued relationships, there are five basic ways to map
> references from one persistence-capable class (the referring class) to a
> related class:
>
> serialized: The entire collection, array, or map is serialized into a
> single column in the primary or secondary table of the referring class.
>
> serialized in a join table: A join table is used to associate multiple
> rows in the join table with a single row in the primary or secondary
> table of the referring class, and the related instances are serialized,
> one per row, into a single column in the join table.
>
> embedded in a join table: A join table is used to associate multiple
> rows in the join table with a single row in the primary or secondary
> table of the referring class, and each related instance is mapped, one
> per row, field by field, into multiple columns in the join table.
>
> by reference to the primary table of the related class: The related
> class has a reference (often, a foreign key) to the primary table of the
> referring class.
>
> by reference in a join table: A join table is used to associate multiple
> rows in the join table with a single row in the primary or secondary
> table of the referring class, and a column in the join table contains a
> reference (often, a foreign key) to the primary table of the related class
.
> </spec>
>
> Craig Russell
>
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>
> 408 276-5638 mailto:Craig.Russell@sun.com
>
> P.S. A good JDO? O, Gasp!
>
>
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
[ Post a follow-up to this message ]
|