Re: Vertical inheritance support proposal

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jun 15 2005 - 17:58:04 EDT

  • Next message: Mike Kienenberger: "Re: Vertical inheritance support proposal"

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > I guess I should try the composition scenario before commenting any
    > further. And of course if there is anything that looks like a bug, we need
    > to record and fix them. :-)

    I wrote,
    > > #1, ObjRelationship.getDbEntity() returns the wrong DBEntity (and breaks
    > > ObjRelationship.refreshFromPath()). This is why I'm unable to determine
    > > the path to the parent entity.

    It's not a bug, just an incompatibility with doing this via SuperEntity.
    I'm sure it works fine if there's no inheritance or if it's single-table
    inheritance.

    If there is annotation support, the composite vertical inheritance can just
    specify the super entity as an annotation rather than using the super-entity
    field.

    On the other hand, these look like bugs to me:

    EntityInheritanceTree.allAttributes() and
    EntityInheritanceTree.allRelationships() only go up the inheritance chain
    one step.

    I'm guessing

        c.addAll(superEntity.getAttributes());

    should be

        c.addAll(superEntity.allAttributes());

    and the same thing with

        c.addAll(superEntity.getRelationships());

    and

        c.addAll(superEntity.allRelationships());

    The only other one that looks suspect is ObjectEntity.getSuperClassName, but
    maybe it works for single-table inheritance.

        public String getSuperClassName() {
            ObjEntity superEntity = getSuperEntity();
            return (superEntity != null) ? superEntity.getClassName() :
    superClassName;
        }

    Since I'm not using single-table inheritance, I'm hesitant to do anything
    other than point out possible problems.



    This archive was generated by hypermail 2.0.0 : Wed Jun 15 2005 - 17:55:30 EDT