Re: Inheritance using two tables

From: Andre Bremer (a.breme..olff-olins.com)
Date: Tue Feb 01 2005 - 10:17:35 EST

  • Next message: Andre Bremer: "Re: Inheritance using two tables"

    Andrus,

    I am after vertical inheritance:

    http://developer.apple.com/documentation/WebObjects/UsingEOModeler/Art/inh_vertical.gif

    Thanks

    Andre

    Andrus Adamchik wrote:

    >Ok.. now I am confused what type of inheritance are we talking about...
    >Horizontal inheritance, the one that I assumed -
    >http://developer.apple.com/documentation/WebObjects/UsingEOModeler/Art/inh_horizontal.gif,
    >or vertical inheritance with "flattened" attributes across tables:
    >http://developer.apple.com/documentation/WebObjects/UsingEOModeler/Art/inh_vertical.gif
    >
    >Andre, which one do you need?
    >
    >Andrus
    >
    >
    >
    >
    >>Andrus,
    >>
    >>Would the modeler/etc allow for a table "A" in this case, too? You'd
    >>want entity B to be composed of tables A&B, entity C composed of tables
    >>A&C, etc.
    >>
    >>Thanks,
    >>
    >>/dev/mrg
    >>
    >>-----Original Message-----
    >>From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    >>Sent: Tuesday, February 01, 2005 9:49 AM
    >>To: cayenne-use..bjectstyle.org
    >>Subject: Re: Inheritance using two tables
    >>
    >>
    >>No comments on the timing, but why wouldn't a common abstract superclass
    >>address your requirements? From what I can tell it provides a *complete*
    >>functional replacement of multi table inheritance (note that in the
    >>modeler you can select a superclass of any entity... so two entities can
    >>have the same custom superclass). E.g.
    >>
    >>public abstract class A extends CayenneDataObject {
    >> public abstract String getX();
    >> public abstract void setX(Stirng x);
    >>
    >> public void doSomething() {
    >> ...
    >> }
    >>}
    >>
    >>public class B extends A { // mapped to table B
    >>
    >>}
    >>
    >>public class C extends A { // mapped to table C
    >>
    >>}
    >>
    >>Anything I might be missing here?
    >>
    >>Andrus
    >>
    >>
    >>
    >>
    >>
    >>
    >>>Andrus Adamchik wrote:
    >>>
    >>>
    >>>
    >>>>Hi Andre,
    >>>>
    >>>>Multiple table inheritance is currently not supported. It should be
    >>>>fairly easy to add, but this has to be done... I guess you'll have to
    >>>>map your tables as independent entities and use a common Java
    >>>>
    >>>>
    >>interface
    >>
    >>
    >>>>or better - a common abstract superclass to achieve a similar effect.
    >>>>
    >>>>Andrus
    >>>>
    >>>>
    >>>>
    >>>>
    >>>Andrus,
    >>>
    >>>Thank you for quick reply.
    >>>
    >>>I am stuck with our existing design, guess I'll have to wait for the
    >>>next cayenne version :)
    >>>
    >>>Anybody any idea when/if this feature will be added?
    >>>
    >>>cheers
    >>>
    >>>Andre
    >>>
    >>>
    >>>
    >>>>>Hi
    >>>>>
    >>>>>How does one map an associated database schema?
    >>>>>Where we have one base table representing the super class and any
    >>>>>number
    >>>>>of other tables representing the concrete sub classes.
    >>>>>
    >>>>>I understand the documentation of single table inheritance but can't
    >>>>>find any help on the above.
    >>>>>
    >>>>>Also I can't search the mail archive, am I missing something?
    >>>>>
    >>>>>cheers
    >>>>>
    >>>>>as
    >>>>>
    >>>>>
    >
    >
    >
    >
    >
    >

    * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    This e-mail message is intended solely for the person to
    whom it is addressed and may contain confidential or
    privileged information. If you have received it in error,
    please notify the postmaste..olff-olins.com
    immediately and destroy this e-mail and any attachments.
    In addition, you must not disclose, copy, distribute or take
    any action in reliance on this e-mail or any attachments.

    Any views or opinions presented in this e-mail are solely
    those of the author and do not necessarily represent
    those of Wolff Olins. E-mail may be susceptible to
    data corruption, interception, unauthorised amendment,
    viruses and unforeseen delays, and we do not accept
    liability for any such data corruption, interception,
    unauthorised amendment, viruses and delays or the
    consequences thereof.
    Accordingly, this e-mail and any attachments
    are opened at your own risk.
    http://www.wolff-olins.com

    * * * * * * * * * * * * * * * * * * * * * * * * * * * *



    This archive was generated by hypermail 2.0.0 : Tue Feb 01 2005 - 10:20:53 EST