Tutorial: Extending a BOD service to manage UserData with the data service layer
- Defines an SQL template statement that fetches data from the new tables.
- Associates a new access profile to the new SQL template statement.
- Associates an XPath expression to the new SQL template statement.
The WebSphere Commerce BOD programming model separates processing into the business logic layer and the persistence layer. The business logic layer works with logical service data objects (SDOs), which are the Java representation of nouns. The persistence layer creates, reads, updates, or deletes business objects in the WebSphere Commerce database. This separation allows adding new data to affect only the persistence layer.
The CatalogEntry noun uses the UserData element as a data extension point to add new data without changing the logical model. In this tutorial, warranty information is added to the CatalogEntry noun UserData element to demonstrate the addition of language-dependent properties. For this tutorial, a warranty applies to a specific catalog entry and consists of a number of days the warranty applies and a warranty type: either limited or comprehensive.
The catalog description noun part supports the attributes element as a data extension point. Attributes provide the same functions as the UserData element. Product care instructions are added to the CatalogEntryDescription noun part attributes element to show the addition of language independent properties. In this tutorial, a care instruction applies to a specific catalog entry and language and consists of a text description of the instruction.
Learning objectives
- Understanding the WebSphere Commerce data service layer
- Overview of simple extension and customization tasks.
- Updating the WebSphere Commerce database with new tables and relationships.
- Generating custom object-relational metadata that describe new tables and relationships.
- Generating static service data objects (SDO) that provide a Java representation of the newly added tables.
- Configuring the logical DataObject to physical DataObject mapping.
- Creating a custom query template file to map an XPath expression and access profile to SQL.
Time required
Expect this tutorial to take one hour to complete. The tutorial takes longer if you explore concepts that are related to this tutorial.Skill level
This tutorial is intended for advanced WebSphere Commerce developers responsible for creating and customizing WebSphere Commerce BOD services. To complete this tutorial, ensure that you are familiar with the following terms and concepts:- Web services
- XML
- WebSphere Commerce services
- Relational databases
- SQL