Re: vertical inheritance joins

From: Lachlan Deck (lachlan.dec..mail.com)
Date: Sun Jun 03 2007 - 16:01:05 EDT

  • Next message: Lachlan Deck: "Re: [CONF] Apache Cayenne Documentation: Inheritance overview (page created)"

    Hi Andrus,

    On 03/06/2007, at 7:12 PM, Andrus Adamchik wrote:

    > On Jun 1, 2007, at 3:24 PM, Lachlan Deck wrote:
    >> On 01/06/2007, at 7:32 PM, Andrus Adamchik wrote:
    >>
    >>> With this in mind we do not need an inheritance ObjRelationship,
    >>> but we may use a DbRelationship to store join semantics (anybody
    >>> mentioned that already??).
    >>
    >> Well the original suggestion I made was for <obj-entity
    >> superRelationship="nameOfRelationship" ...> to allow for
    >> specifically specifying vertical inheritance (which would have the
    >> effect of not listing this relationship along with those returned
    >> from objEntity.getRelationships() but via
    >> objEntity.getSuperRelationship().
    >
    > This is what I was trying to avoid - introducing relationships with
    > special behavior.

    Okay. It'd be perhaps less obvious what type of inheritance was in
    play in the modeller but then again perhaps a simple dynamic label
    could display something to the same effect along with the below
    validation.

    >> Are you suggesting that you'd prefer <db-entity
    >> superRelationship="nameOfRelationship" ...>
    >
    > No, as DbEntities (tables) do not have inheritance among
    > themselves. It would be more of <obj-entity
    > superDbRelationship="nameOfDBRelationship" ...>, but I do believe
    > that this can be made implicit, as arguably there can be only one
    > DbRelationship between the primary keys of two tables. E.g:
    >
    > SuperOE -> DB1
    > SubOE1 -> DB2
    > SubOE2 -> DB3
    >
    > In this case Cayenne can easily figure out the name of DB2->DB1 and
    > DB3->DB1 relationships based on relationship semantics.

    Okay great. I suppose there'd need to be validation to that effect to
    ensure that such relations exist when choosing a different DbEntity
    from the parent entity.

    >>> Another nice side effect of it is that such relationship is not a
    >>> part of the object model (ObjRelationship would've been an object
    >>> property). So there is nothing artificial about such mapping, and
    >>> no new concepts are needed in Cayenne to map it.
    >>
    >> Can you clarify this a bit more.
    >
    > See above - I don't want to redefine what ObjRelationship is. The
    > difference between Cayenne and EOF is that Cayenne splits DB and
    > Java mapping in two separate layers of metadata. EOF allows to mark
    > a relationship as "not included in the object model", while Cayenne
    > allows to map the DB relationship without mapping corresponding
    > ObjRelationship, essentially achieving the same thing in a
    > different way.

    Thanks. Just a slight mind-shift ;-)

    with regards,

    --
    

    Lachlan Deck



    This archive was generated by hypermail 2.0.0 : Sun Jun 03 2007 - 16:01:38 EDT