Implementing the persistence layer for the WebSphere Commerce BOD programming model
The BOD programming
model provides a Data Service
Layer that is independent of the physical schema. In this lesson,
you use the Data Service Layer wizard to generate the service data
objects and object-relational metadata. The Data Service Layer wizard
takes a list of the database tables as input and generates the object-relational
mapping information and the static physical SDOs representing these
tables.
About this task
- Static physical Service Data Objects (SDO) that provide
a Java
representation of the service module view of the WebSphere 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.
- Object-relational metadata that maps a physical SDO to the actual physical table in the WebSphere Commerce schema.
- Query templates that map WebSphere Commerce extended XPath notation expressions to one or more SQL template queries. These SQL template queries are used to retrieve the physical data from the database. This data is represented as physical SDOs.
- A logical SDO (noun) to physical SDO mapping. For each logical SDO, this mapping defines the physical SDO that contains the unique ID of the noun.
- Business object mediators that build logical
SDOs from physical
SDOs and physical SDOs from logical SDOs.
- Read Mediators: Read mediators build a logical SDO out of the physical SDO using the defined mapping.
- Change Mediators: Change mediators take a logical SDO as input and either create, update, or delete the appropriate physical SDOs. The modified physical SDOs are then saved back to the database.
Procedure
Results
- The physical SDOs are generated in the Project-Server project under ejbModule/com.mycompany.commerce.project.facade.server.entity.datatypes. These SDOs provide a Java view of the database for the Project service.
- An object-relational metadata file that describes the relationship between the physical SDOs and the database. This file is stored in the Project service module configuration folder under WC_eardir/xml/config/com.mycompany.commerce.project/wc-object-relational-metadata.xml.