This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 211305 - Add XMLType or data-type support to the EclipseLink-ORM.XML Schema
Summary: Add XMLType or data-type support to the EclipseLink-ORM.XML Schema
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 248239 (view as bug list)
Depends on:
Blocks: 325781
  Show dependency tree
 
Reported: 2007-11-28 14:28 EST by Guy Pelletier CLA
Modified: 2022-06-09 10:19 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Pelletier CLA 2007-11-28 14:28:54 EST
 
Comment 1 Doug Clarke CLA 2008-02-19 09:57:19 EST
Current docs: http://wiki.eclipse.org/Configuring_a_Relational_Direct-to-XMLType_Mapping_(ELUG)

Although no useful code currently exists.
Comment 2 Doug Clarke CLA 2008-02-19 10:46:02 EST
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>



Comment 3 Tom Ware CLA 2009-04-16 10:58:32 EDT
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.
Comment 4 Guy Pelletier CLA 2009-12-08 09:28:21 EST
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.
Comment 5 Guy Pelletier CLA 2010-02-22 15:56:34 EST
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.
Comment 6 Gordon Yorke CLA 2011-08-29 13:14:32 EDT
Instead of an entire new annotation why not follow the @LOB pattern and create an augmenting annotation for @Basic?  Like @XML or @JDBCType("XML")
Comment 7 Shaun Smith CLA 2011-08-29 14:50:32 EDT
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
Comment 8 Shaun Smith CLA 2011-08-29 14:54:23 EDT
*** Bug 248239 has been marked as a duplicate of this bug. ***
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:19:57 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink