Re: Inheritance using two tables

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Feb 01 2005 - 09:48:34 EST

  • Next message: Gentry, Michael \(Contractor\): "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 archive was generated by hypermail 2.0.0 : Tue Feb 01 2005 - 09:48:36 EST