Re: Vertical inheritance support proposal

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jun 15 2005 - 17:16:43 EDT

  • Next message: Andrus Adamchik: "Re: Vertical inheritance support proposal"

    > If I can't determine it from the existing info (the relationship should
    > meet the criteria of isToMasterPK and not toMany), then it'll somehow
    have to
    > be indicated by the DataMap.

    That's where the annotations come in ...

    Some background first. There was a bunch of requests from different people
    to add support to the Modeler for associating custom key-value pairs with
    entities. I think we have a JIRA issue somewhere (?) This was supposed to
    be used for things like JavaDocs, generation of specific UI widgets
    (http://sourceforge.net/projects/jomwc/), etc. Kind of like in 1.2
    DataContext has "userProperties" map. I am suggesting the same thing to be
    done for entities.

    So you given Person and PhantomCustomer entities, you might create an
    entity Customer (inherits from Person via single table inheritance) with a
    custom key "compositionPath" and a value "toCustomer". This will instruct
    a special Velocity template to traverse Person -> PhantomCustomer
    relationship and generate getters and setters for all its properties that
    encapsulate the composition (and also add "PhantomCustomer" automatically
    to all new Customer instances. ... So no need to "guess" the inheritance.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Jun 15 2005 - 17:16:44 EDT