Develop > Persistence layer > Work with WebSphere Commerce services


Create and updating Service Data Objects (SDO)

The steps on this page describe how to create or update a service data object genmodel file. A genmodel is an EMF model asset that is used to generate code. It is initialized from a set of XSD schemas.


Before you begin

If you are extending an existing WebSphere Commerce noun, you do not need to perform these prerequisite steps - the service module has already been created.

The examples in this task are based on the service generated in Create a WebSphere Commerce service module.


Procedure

  1. Start WebSphere Commerce Developer.

  2. Update the pattern generated noun with the changes.

    1. The pattern generated noun definition is located in the following file:

      MyServiceModuleName-DataObjects > xsd > OAGIS > 9.0 > Overlays > MyCompany > Commerce > Resources > Nouns > MyBusinessObject.xsd

    2. Update this schema with the required definition for the logical object model. This file is used to describe the logical object model (noun).

    3. Save and close the file.

  3. Generate SDOs from the noun definition.

    SDOs are generated using an EMF genmodel. The pattern generates a sample genmodel that must first be updated with the noun definition.

    1. Expand MyServiceModuleName-DataObjects > ecore.

    2. Right-click MyServiceModuleName.genmodel.

    3. Click Reload....

    4. Select XML Schema and click Next.

    5. Click Next.

    6. Click Finish

      By default, the genmodel references the WebSphere Commerce foundation data objects. This schema is used by the EMF utility to generate Java classes that represent the noun.

      If the custom noun references additional data objects, click Add to add other genmodels.

    7. The genmodel reloads and opens in Rational Application Developer.

    8. To generate the SDOs, right click MyServiceModuleName and select Generate Model Code.

    9. The SDOs representing the noun are generated in MyServiceModuleName-DataObjects > src.


Related concepts

WebSphere Commerce Web services

WebSphere Commerce service module

Service Data Objects (SDO)


Related tasks

Generate code from an SDO genmodel file

Update Service Data Objects


+

Search Tips   |   Advanced Search