Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] Specifying Superclass in OXM

Yes I agree, super-type looks better.

On 27/09/2010 3:45 PM, Mike Norman wrote:
Yeah, I prefer 'super-type'
---
Mike Norman 

On 27/09/2010 3:41 PM, douglas clarke wrote:
A little odd that we would use "java-type" and "super-class".

I would suggest either "super-type" or "extends"

<java-type name="model.LargeProject" super-type="model.Project"
<java-type name="model.LargeProject" extends="model.Project"

Doug

On 27/09/2010 2:10 PM, Rick Barkhouse wrote:
Hi all,

We currently do not have any way in OXM to specify the superclass of a particular java-type.  This information will be needed for Dynamic JAXB because there will be no underlying Java model to introspect.

I don't think there is a real parallel to the JPA style of specifying inheritance in ORM (e.g. mapped-superclass, inheritance strategy etc), I think we could simply add a "super-class" attribute.  For example:
    <java-types>
        <java-type name="com.foo.Project" xml-discriminator-node="@ptype" xml-discriminator-value="P">
            <java-attributes>
                <xml-element java-attribute="id" type="java.lang.Integer"/>
                <xml-element java-attribute="desc" type="java.lang.String"/>
            </java-attributes>
        </java-type>

        <java-type name="com.foo.LargeProject" super-class="com.foo.Project" xml-discriminator-value="L">
            <java-attributes>
                <xml-element java-attribute="budget" type="java.lang.Double"/>
            </java-attributes>
        </java-type>
    </java-types>
Any objections to adding super-class ?  Non-Dynamic users would not need to specify this attribute, but if they did it would override the actual superclass.

--
Rick Barkhouse | Software Developer, EclipseLink | 613.288.4613
Oracle Development
45 O'Connor Street, Suite 400 | Ottawa, Ontario K1P 1A4

--
Rick Barkhouse | Software Developer, EclipseLink | 613.288.4613
Oracle Development
45 O'Connor Street, Suite 400 | Ottawa, Ontario K1P 1A4

Back to the top