Re: vertical inheritance joins

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jun 01 2007 - 05:32:58 EDT

  • Next message: Andrus Adamchik: "Re: Abstract Entities [Was: Modelling improvements: inheritance + interfacing (Draft)]"

    This was a long thread, and I may have missed some points already
    made. Let me try to summarize this discussion and add my comments to
    it. There are two aspects of the "vertical inheritance relationship":

    1. Specifying the join semantics for non-trivial PK-to-PK mapping
    (such as compound keys).
    2. Specifying delete rules.

    I am with Ari on (1) - it is in the Cayenne philosophy to map things
    explicitly, so that various weird legacy schemas can still be mapped.
    I am with Craig on (2) - if a user expects to delete a record from a
    subclass table without deleting a record in a superclass table, this
    situation should not be mapped as inheritance, as it breaks the ORM
    model at a fundamental level (an object is deleted, but some of its
    properties still remain persistent - BAD).

    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??). 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.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Jun 01 2007 - 05:33:23 EDT