Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Examples/SDO/DynamicAPI"
< EclipseLink | Examples | SDO
(→Using DataFactory) |
(→Using DataObject) |
||
Line 8: | Line 8: | ||
===Using DataObject=== | ===Using DataObject=== | ||
+ | Once you have a DataObject you can use it to create child DataObjects based on its properties: | ||
+ | <source lang="java"> | ||
+ | DataObject contactInfoDO = customerDO.createDataObject("contact-info"); | ||
+ | DataObject billingAddressDO = contactInfoDO.createDataObject("billing-address"); | ||
+ | </source> |
Revision as of 16:36, 24 February 2009
Creating DataObjects
Using DataFactory
DataObjects can be created by Type using DataFactory:
Type addressType = TypeHelper.INSTANCE.getType("http://www.example.org/customer-example", "address-type"); DataObject addressDO = DataFactory.INSTANCE.create(addressType);
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");