Re: [JIRA] Created: (CAY-733) Support for embeddable classes

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jan 22 2007 - 08:18:12 EST

  • Next message: Craig L Russell: "Re: [JIRA] Created: (CAY-733) Support for embeddable classes"

    On Jan 22, 2007, at 2:48 PM, Aristedes Maniatis wrote:

    > On 22/01/2007, at 10:47 PM, Andrus Adamchik (JIRA) wrote:
    >
    >> JPA specification supports a notion of "embeddable" class.
    >> Embeddable classes can be viewed as multi-column custom types that
    >> do not have their own identity and belong to another persistent
    >> object. Entities that embed them can override DB column mapping.
    >> Currently Cayenne supports single-column custom types via
    >> ExtendedType mechanism. We need to expand that to support multi-
    >> column Embeddables and mapping via the Modeler.
    >
    > When would you use such a thing? I am trying to think of how this
    > is useful, but perhaps I'm missing the point of the concept. Would
    > this be used to create a type of inheritance between classes, such
    > as company and person having a common billing address class but
    > relating back to completely separate address fields in each of the
    > company and person tables in the db?

    Indeed IMO this is somewhat of an optional edge case in ORM (although
    the JPA spec does require it). It adds extra flexibility to the
    object design, allowing to map a composition of objects to a single
    table. I think your inheritance example is a good one - you can have
    the same Java class with specific OO behavior (e.g. Address) shared
    across different entities and mapped to different columns.

    > Also, is it a goal to make 3.0 fully JPA compliant or is that too
    > ambitious in the timeframe (I'm guessing a reasonable target for
    > 3.0 would be some time in 6-9 months).

    Yes - the goal is to make 3.0 fully compliant. Although I'd postpone
    the final decision till we finally start in-container integration
    testing and running against the Sun TCK. In any event the plan is to
    start posting 3.0 milestone releases ASAP.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Jan 22 2007 - 08:18:47 EST