Develop > Business logic layer > Work with the data service layer > Extend the WebSphere Commerce schema using the data service layer


Accept object-relational metadata and Physical Service Data Objects to reflect schema changes using the Data Service Layer Wizard

The WebSphere Commerce Data Service Layer Wizard generates the physical SDO Java classes for the customizations, along with the required object-relational metadata and configuration for business object mediators.  These steps are required if you add a new table, and also for any new service modules you develop. XML assets that are generated are stored in the service module configuration extension directories and custom physical SDO Java classes are stored inside the WebSphereCommerceServerExtensionsLogic project.


Before you begin

The schema contains the new tables for which the physical SDO Java classes and object-relational mapping are needed.

This task describes how to use the Data Service Layer Wizard to add object-relational metadata and generate the physical SDO classes for a customized schema. This wizard allows you to perform the following tasks:

You must use supported database column data types in the custom tables. Supported data types are described in Database column data type considerations. If you use unsupported data types, tools such as the Data Service Layer Wizard and the staging server will encounter errors.


Reading the log file generated by the Data Service Layer Wizard

The Data Service Layer Wizard's .log file located in the RAD_INSTALL/workspace/.metadata directory can become very large. This is due to the generation of many lines of information into the log file by all the eclipse plugins. While this file can contain a large amount of information, you can determine the relevance of each message by observing the Plugin ID, which serves as a prefix to all messages contained in the log.

To determine which messages are relevant to the Data Service Layer Wizard, simply observe all messages which are prefixed by the Plugin ID com.ibm.commerce.toolkit.internal.dataaccess in the log file.


Procedure

Use the Data Service Layer wizard to generate object-relational metadata and physical data objects representing the customized schema.

  1. If the development environment uses an Apache Derby database, ensure that there is no existing connection to it (for example, ensure that the WebSphere Commerce Server is stopped).

  2. Select File > New > Other > WebSphere Commerce > Data Service Layer .

  3. Click Next.

  4. Select Extend a default WebSphere Commerce service module or Work with a custom service module.

  5. Enter the required information. In Service module , select the name of the module for which you are building SDOs. In Extension class prefix enter a string that is used to prefix all classes that are generated. In Extension Java package name enter the name of the package that will contain the SDOs.

    For example, if we are extending the catalog schema, the values would be...

    • Service module: Select com.ibm.commerce.catalog

    • Extension class prefix: MyCompany

    • Extension Java package name: com.mycompany.commerce.catalog

  6. Click Next.

  7. Select the custom tables you have added to the schema.

  8. Under each table you have selected, select the columns to include in the SDO class. Primary key columns, non-nullable columns, and the optcounter column are automatically selected. Primary key columns are not available, because include them in the SDO.

  9. Click Next.

  10. On the Metadata Editing panel, you can choose what columns to include in the UserData area of the logical schema, by clicking the UserData column to set the value to true or false.

  11. If you use the Oracle NUMBER data type in a custom table, choose a more granular data type to map to. The Oracle NUMBER data type can represent different multiple types, including integer, long, float, and double. Using the dropdown list in the Datatype column, choose the appropriate mapping.

  12. Click Finish.


Related concepts

Data service layer

Business Object Mediator

Physical data container


+

Search Tips   |   Advanced Search