Implementing the persistence layer for the HCL Commerce BOD programming model

The BOD programming model provides a JPA framework to replace the DSL in V9. In this lesson, you use the JPA framework to generate service data objects.

About this task

Each service module, for example, Catalog and Marketing, has an independent data service implementation that contains the following assets:
  • Static physical Service Data Objects (SDO) that provide a Java representation of the service module view of the HCL Commerce schema. Each service module has a physical SDO for the tables that are read, updated, or deleted by the service module. For example, the catalog service module contains a physical SDO for the CATALOG table but the catalog service module does not contain a physical SDO for the ORDER table.
    Note: These physical SDOs are independent of the SDOs that are used to represent the logical model of a service module.
For more information, see Tutorial: Customizing the Transaction server using REST and JPA services.

Procedure

  1. Select the Rest-config\beanMapping-ext and Rest-config\commandMapping-ext folders and the file resources-ext.properties in the temporary location and copy them to the corresponding location in the development environment. If the file already exists at that location, merge it with this copy.
  2. Copy all the java code from WebSphereCommerceServerExtensionsLogic and WebSphereCommerceServerExtensionsData to your corresponding location.
  3. Publish the JAR files to the transaction server.
  4. Verify the two rest API which were used, by issuing a get project call by Primary Key (PK), and a change project name.
  5. Oracle Get Project by PK (method: GET):
    https://9.111.139.128:443/wcs/resources/store/1/project?xproject_id=2001
    Change project name by PK (method: PUT):
    https://9.111.139.128:443/wcs/resources/store/1/project?xproject_id=2001

Results

You have created service data objects using JPA, and verified that they are functional.