Skip to main content
Jump to: navigation, search


< EclipseLink‎ | Examples‎ | SDO
Revision as of 16:01, 24 February 2009 by (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Creating DataObjects

Using DataFactory

DataObjects can be created by Type using DataFactory:

Type customerType = TypeHelper.INSTANCE.getType("", "customer-type");
DataObject customerDO = DataFactory.INSTANCE.create(customerType);

Using DataObject

Once you have a DataObject you can use it to create child DataObjects based on its properties:

DataObject contactInfoDO = customerDO.createDataObject("contact-info");
DataObject billingAddressDO = contactInfoDO.createDataObject("billing-address");

Getting/Setting Properties

An SDO path (similar to XPath) can be used with the String based accessors:

DataObject billingAddressDO = customerDO.getDataObject("contact-info/billing-address");

Back to the top