On Jun 3, 2007, at 2:00 AM, Craig L Russell wrote:
> I hope this doesn't confuse things more, but in reality, you often
> have schema that fall into multiple categories of mapping.
No confusion at all - in reality we do have to deal with mixed
scenarios, so we have to account for them.
> For example, a hierarchy might have a table that maps all of the
> fields of the superclass A. Class B extends A and has a table BS
> containing a discriminator column WHICHB and the fields of all of
> the subclasses of B. Another class C extends A and its table C maps
> only the fields of class C while subclasses C1 and C2 each have
> their own table for their fields.
>
> To make it easier on the ORM, table A might also include a
> discriminator column WHICHA that explicitly identifies the class
> that the row corresponds to.
One note - in Cayenne discriminator column is implemented via a more
generic entity qualifier expression (e.g. it can match multiple
columns or use some custom comparison condition). This approach
generally prevents a simplification of a mandatory discriminator
column on a root class, although we may actually work around it and
start by implementing a simplified case (i.e. support entity
qualifiers in the form "attribute = constant" on all subentities).
I am still entertaining the idea that we can support vertical
inheritance without a designator column, and I don't think that
having such column in place is such a big shortcut in implementation.
After all the logic will be the same as with horizontal inheritance -
sublcass criteria is an existence of a row in the subclass table).
Andrus
This archive was generated by hypermail 2.0.0 : Sun Jun 03 2007 - 04:50:26 EDT