On 01/06/2007, at 9:37 AM, Aristedes Maniatis wrote:
> Is that terminology right? That page says:
>
> * single-table == flat == table-per-class-hierarchy
Easily true.
> * Vertical == table-per-subclass
That is wrongly named. That is horizontal inheritance where the
parent doesn't map to a table. Vertical involves parent and kids each
having their own table. (See http://developer.apple.com/documentation/
WebObjects/UsingEOModeler/index.html as an example)
> * Horizontal == table-per-concrete-class
Correct, though hazy terminology for mine seeing as vertical also has
a table for the parent.
The JPA for better or worse has:
- Inheritance.SINGLE_TABLE. That's the easy one.
- Inheritance.JOINED. Most definitely == vertical.
- Inheritance.TABLE_PER_CLASS. This is (for mine anyway) an unclear
name given that JOINED is also a table per class. It would have been
clearer if they'd chosen TABLE_PER_SUBCLASS.
> My page says:
>
> * single-table
> * horizontal == table-per-class
> * vertical == joined
That is correct.
From the JPA:
Joined: A strategy in which fields that are specific to a subclass
are mapped to a separate table than the fields that are common to the
parent class, and a join is performed to instantiate the subclass.
Table-per-class: A table per concrete entity class.
As additional support for this... see also description here (http://
java.sys-con.com/read/286901.htm) which documents them a little more
verbosely as:
SINGLE_TABLE: Single-table-per-class inheritance hierarchy. This is
the default strategy. The entity hierarchy is essentially flattened
into the sum of its fields, and these fields are mapped down to a
single table.
JOINED: Common base table, with joined subclass tables. In this
approach, each entity in the hierarchy maps to its own dedicated
table that maps only the fields declared on that entity. The root
entity in the hierarchy is known as the base table, and the tables
for all other entities in the hierarchy join with the base table.
TABLE_PER_CLASS: Single-table-per-outermost concrete entity class.
This strategy maps each leaf (i.e., outermost, concrete) entity to
its own dedicated table. Each such leaf entity branch is flattened,
combining its declared fields with the declared fields on all of its
super-entities, and the sum of these fields is mapped onto its table.
with regards,
--Lachlan Deck
This archive was generated by hypermail 2.0.0 : Thu May 31 2007 - 22:14:50 EDT