JDO
  1. JDO
  2. JDO-702

Support for specification of embedded inherited objects

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JDO 3 (3.0)
    • Fix Version/s: JDO 3.1-rc1
    • Component/s: api, specification, tck
    • Labels:
      None

      Description

      While JDO2+ allows specification of embedded objects stored with primary objects, it doesn't have any specific way of specifying the embedded object as being inherited and how you would persist it. In particular there is no way to define a discriminator (column) for the embedded object. If we have an example from the JDO spec, and if we have a subclass of Address as also persistable, then we need to specify the discriminator for "primaryAddress" field.

      <class name="Employee" table="EMP">
      ...
      <!-- field type is Address -->
      <field name="primaryAddress">
      <embedded null-indicator-column="PADDR_STREET">
      <discriminator column="PADDR_DISCRIM"/>
      <field name="street" column="PADDR_STREET"/>
      <field name="city" column="PADDR_CITY"/>
      <field name="state" column="PADDR_STATE"/>
      <field name="zip" column="PADDR_ZIPCODE"/>
      </embedded>
      </field>
      </class>

      So the XSD/DTD need updates to allow <discriminator> under <embedded>, the JDO Metadata API needs to allow this also, and the @Embedded annotation needs a "discriminator" attribute adding.

      1. JDO-702-test.patch
        31 kB
        Andy Jefferson
      2. JDO-702.patch
        3 kB
        Andy Jefferson

        Activity

        Craig L Russell made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael Bouschen made changes -
        Fix Version/s JDO 3 maintenance release 1 (3.1) [ 12314921 ]
        Affects Version/s JDO 3 (3.0) [ 12313404 ]
        Craig L Russell made changes -
        Assignee Craig L Russell [ clr ]
        Andy Jefferson made changes -
        Attachment JDO-702-test.patch [ 12510725 ]
        Andy Jefferson made changes -
        Attachment JDO-702.patch [ 12505091 ]
        Andy Jefferson made changes -
        Attachment JDO-702.patch [ 12505090 ]
        Andy Jefferson made changes -
        Attachment JDO-702.patch [ 12505090 ]
        Andy Jefferson made changes -
        Attachment JDO-702.patch [ 12505080 ]
        Andy Jefferson made changes -
        Field Original Value New Value
        Attachment JDO-702.patch [ 12505080 ]
        Andy Jefferson created issue -

          People

          • Assignee:
            Craig L Russell
            Reporter:
            Andy Jefferson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development