Using Data

Using DataObject

A DataObject in SDO corresponds to a Java Object (POJO).
To define object-XML mappings, you map the DataObject to XML.
You can create your data object as either dynamic (see Dynamic DataObject Examples), or static by applying a type-safe interface to it (see Static DataObject Examples).
The DataObject provides an XPath-like (see Mappings and XPath) means of data access. For example, the following code is valid in SDO:

customerDO.getDataObject("contact-info/phone-number[2]");

The standard JAXB, however, would require the following:

customer.getContactInfo().getPhoneNumbers().get(1);

Note that you can use the EclipseLink XPathHelper to query data objects using an XPath expression.