Skip to main content

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

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

Back to the top