Community
Participate
Working Groups
Current docs: http://wiki.eclipse.org/Configuring_a_Relational_Direct-to-XMLType_Mapping_(ELUG) Although no useful code currently exists.
NATIVE configuration: DirectToXMLTypeMapping mapping = new DirectToXMLTypeMapping(); // configure mapping. This example maps a mapping.setAttributeName("resume"); mapping.setShouldReadWholeDocument(false); descriptor.addMapping(mapping); Configurable items to consider: 1. Attribute field/property 2. Lazy-loading (fetch-group) 3. Read Whole Document 4. read-only: Handled through @Column's insertable/updatable 5. Custom properties NOTE: I am not sold on @BasicXML but it is a starting point for discussion since DirectToFieldMapping is annotated with JPA's @Basic @BasicXML(fetch=FetchType.LAZY, optional=true, readWhole=true) @Access(AccessType.PROPERTY) @AccessMethods(get="getXMLDoc", set="setXMLDoc") @Properties({ @Property(name="x", value="y") }) @Column(name="XML_DOC") private String document Reflecting this same example in XML might look like: <basic-xml name="document" fetch="LAZY" optional="true" read-whole="true"> <access type="PROPERTY"/> <access-methods get="getXMLDoc" set="setXMLDoc"/> <properties> <property name="x" value="y"/> </properties> </basic-xml>
Updating priority due to revised bug categorization process. See the following page for details: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines#Priority_and_Target_Milestone If you feel the updated priority is incorrect, please send an email to eclipselink-users@eclipse.org.
Instead of an entire new annotation why not follow the @LOB pattern and create an augmenting annotation for @Basic? Like @XML or @JDBCType("XML")
When defining an XMLType mapping using the native API, DDL generation fails when the column definition on the field is not specified [1]. Here's Doug's example with an additional line that resolves the problem: DirectToXMLTypeMapping mapping = new DirectToXMLTypeMapping(); // configure mapping. This example maps a mapping.setAttributeName("resume"); mapping.getField().setColumnDefinition("XMLTYPE"); mapping.setShouldReadWholeDocument(false); descriptor.addMapping(mapping); DDL generation need to be included in this enhancement. [1]https://forums.oracle.com/forums/thread.jspa?threadID=2273441&tstart=0
*** Bug 248239 has been marked as a duplicate of this bug. ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink