db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig L Russell (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JDO-702) Support for specification of embedded inherited objects
Date Fri, 13 Jan 2012 17:48:39 GMT

    [ https://issues.apache.org/jira/browse/JDO-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13185696#comment-13185696
] 

Craig L Russell commented on JDO-702:
-------------------------------------

Not clear that we need to update the company model. A stand alone model for just this feature
would work for me.

The advantage of the company model is that there is a lot of infrastructure already written.
And changing the Address classes/interfaces probably isn't best because the most common case
for Address is embedded without subclasses. So probably another model is needed anyway. Or
create another package outside the company model but use the company infrastructure (e.g.
the completeness test).

You also want to make sure that the query features (cast, relationships from embedded subtypes,
projections of embedded types) work properly.

                
> Support for specification of embedded inherited objects
> -------------------------------------------------------
>
>                 Key: JDO-702
>                 URL: https://issues.apache.org/jira/browse/JDO-702
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>            Reporter: Andy Jefferson
>         Attachments: JDO-702.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message