Re: ObjEntity spanning multiple DbEntities proposal

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 27 2003 - 22:26:24 EST

  • Next message: Craig Miskell: "Re: Attributes to fetch"

    Craig Miskell wrote:
    > On Fri, 2003-02-28 at 05:38, Andriy Shapochka wrote:
    >
    >>Let me propose for implementation a new Cayenne feature that seems useful and interesting
    >
    > and arises from the needs of the project I am working on. Please give your comments.
    > <snip>
    >
    >>This feature is, in fact, very much like the concept of flattened relationships,
    >
    > only a DbRelationship is hidden inside an ObjEntity.
    >
    > +1.
    >
    > I can see a whole lot of uses for this... inheritance being the obvious
    > one. Another is when you split out BLOBS into separate tables (old
    > Oracle problem, one BLOB column per table... makes life a pain)... this
    > way we hide the db specific madness and have nice clean objects at the
    > top level, without writing any additional delegation type code.
    >
    > Craig

    I guess suggested feature is somewhere between flattened relationships
    and to our inheritance discussion :-) :

       http://objectstyle.org/cayenne/pending/inheritance.html

    "+1" For the idea. I personally have tons of master-detail relationships
    in my current TopLink project. Having a good way to address this would
    be really cool.

    "-1" for the implementation. I think it needs more thought.

    First of all I oppose DbEntity inheritance. This complicates any
    operations using the mapping. Even DerivedDbEntities that I introduced
    long time ago don't seem to be in the right place. This should all be
    done at the Obj level.

    Another concern is to avoid extra mapping artifacts if we can use
    generic ones. For instance there are other cases when we might want to
    join multiple entities, not just strictly "master-detail".

    So my suggestion is to implement this at the level of
    ObjEntity/ObjAttribute, with ObjAttribute being potentially "flattened"
    to span a few relationships (DbRelationships that is). This way we can
    do master-detail or any other kinds of complex mappings.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Feb 27 2003 - 22:27:43 EST