Difference between revisions of "EclipseLink/Examples/SDO/JAXB"
< EclipseLink | Examples | SDO
(→Create the JAXBHelperContext) |
(→Create the JAXBHelperContext) |
||
Line 5: | Line 5: | ||
==Create the JAXBHelperContext== | ==Create the JAXBHelperContext== | ||
The JAXBHelperContext is instantiated using a JAXBContext. This JAXBContext represents the object-to-XML mapping for the POJOs. If static DataObjects are being used, a second constructor is offered that takes a ClassLoader as a parameter. | The JAXBHelperContext is instantiated using a JAXBContext. This JAXBContext represents the object-to-XML mapping for the POJOs. If static DataObjects are being used, a second constructor is offered that takes a ClassLoader as a parameter. | ||
− | + | <pre> | |
+ | JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer"); | ||
+ | JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext); | ||
+ | </pre> | ||
For help on creating a JAXBContext see: | For help on creating a JAXBContext see: | ||
* [[EclipseLink/Examples/MOXy/JAXB#Creating_a_JAXBContext_using_jaxb.properties | Creating a JAXBContext using jaxb.properties]] | * [[EclipseLink/Examples/MOXy/JAXB#Creating_a_JAXBContext_using_jaxb.properties | Creating a JAXBContext using jaxb.properties]] |
Revision as of 11:33, 30 January 2009
Contents
Overview
The JAXBHelperContext is a bridge between POJOs and SDO DataObjects. The bridge is based on their corresponding XML representations. For the POJOs the XML representation is specified using JAXB annotations or object-to-XML mappings.
Create the JAXBHelperContext
The JAXBHelperContext is instantiated using a JAXBContext. This JAXBContext represents the object-to-XML mapping for the POJOs. If static DataObjects are being used, a second constructor is offered that takes a ClassLoader as a parameter.
JAXBContext jaxbContext = JAXBContext.newInstance("com.example.customer"); JAXBHelperContext jaxbHelperContext = new JAXBHelperContext(jaxbContext);
For help on creating a JAXBContext see: