IBM Support

Generating wrapper business object and executing operations on wrapper business object

Troubleshooting


Problem

How to generate wrapper business object and execute operations on wrapper business object.

Symptom

Don't know on how to handle wrapper business object.

Resolving The Problem

Generating wrapper business object:
1. Create three tables using the following script:
CREATE TABLE customer
(
pkey VARCHAR2(10) NOT NULL PRIMARY KEY,
fname VARCHAR2(20),
lname VARCHAR2(20),
ccode VARCHAR2(10)
);

CREATE TABLE custinfo
(
ccode VARCHAR2(10) NOT NULL PRIMARY KEY,
cdata VARCHAR2(10)
);

create table CUSTOMER_COMPOSITEKEY
(
FNAME VARCHAR2(20) not null,
LNAME VARCHAR2(20) not null,
CCODE VARCHAR2(20)
);

alter table CUSTOMER_COMPOSITEKEY
add constraint CUSTOMER_COMPOSITEKEY primary key (FNAME, LNAME);

2. Generate a wrapper business object for the tables customer, custinfo and CUSTOMER_COMPOSITEKEY.
For information about how to generate a wrapper business object, see the section “Setting global properties for operations and creating wrapper business objects” in the info center for WebSphere Adapter for JDBC and "Chapter 14. Tutorial 10: Generate wrapper business objects” in the Business Process Management Samples & Tutorials site for WebSphere Adapter for JDBC.
Link to samples and tutorials:
http://publib.boulder.ibm.com/bpcsamp/externalconnections/jdbcAdapterv6…”.
Link to WebSphere Adapter for JDBC Info center:
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/index.jsp?topic=/com.ibm.wsadapters.620.jca.jdbc.doc/doc/tjdb_outconfigselobjs.html

Executing operations on a wrapper business object:

In this scenario wrapper business object generated WrapperBO contains three child business objects YuanjsCustInfo that has a primary key (ccode), YuanjsCustomer_Compositekey that has a composite primary key (fname, lname), and YuanjsCustomer that has a primary key (pkey). The following sections describe how to execute the Create, Update, Delete and Retrieve operations on this wrapper business object.


The Create operation:
To execute the “create” operation successfully, you must enter data in all the primary key attributes of child business objects as shown in the figure below.
The figure below shows the result of executing the "create" operation successfully.


The Update operation:
To execute the “update” operation successfully, you must enter the data in all the primary key attributes of child business objects as shown in the figure below.

The figure below shows the result of executing the "update" operation successfully.


The Delete operation:
To execute the “delete” operation successfully, you must enter the data in all the primary key attributes of child business objects as shown in the figure below.

The figure below shows the result of executing the "delete" operation successfully.


The Retrieve operation:
The “retrieve” operation is used for primary key attributes and only for extracting matching records. To executing “retrieve” operation successfully, you must
a. Unset all attributes with no child business object on “WrapperBO”
b. Unset non-primary key attributes in child business objects
c. Enter data on all primary key attributes of child business objects.


The figure below shows the result of executing the "retrieve" operation successfully.

Note: you are forbidden to input data on the part of primary key attributes, not cover all primary key attributes like the figure below. It is mandatory to enter the data on all primary key attributes to avoid a failure.

[{"Product":{"code":"SSMKUK","label":"WebSphere Adapters Family"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Adapter for JDBC","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"7.0;6.2","Edition":"WBI","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
15 June 2018

UID

swg21422891