WebSphere Adapter for JDBC

RetrieveAll operation

The adapter uses the RetrieveAll operation to retrieve an array of business objects from the database. The process differs depending on whether the RetrieveAll operation is for database table business objects or for user-specified SQL business objects.

For database table business objects

All of the key and non-key attributes populated in the incoming business object determine the selection criteria. The adapter may retrieve multiple rows for the top-level business object from the database, depending on the attributes selected. If no attributes are populated in the incoming business object, all the rows are retrieved from the respective table in the database.

The adapter performs the following steps to retrieve an array of business objects:
  1. For each of the rows retrieved from the database, the adapter constructs a top-level business graph and creates a container of business graphs using all of the retrieved rows. The name of the container business object is BOName + ContainerBG.
  2. The adapter retrieves each of the business graphs in the container using the Retrieve operation.
Figure 1. Structure of the business object returned in a RetrieveAll operation
This figure has a box at the top titled CustomerContainerBO. From this box a line extends downward. The line has two branches extending to the right. The first branch has two boxes connected by a line. The first box is titled CustomerBG and the second is Customer. A line extends downward from the Customer box to a box titled Address BO. The second branch has the same configuration as the first branch.
The following errors can result from a RetrieveAll operation:

For user-specified SQL business objects

Business objects that are created for user-specified SQL statements also support the RetrieveAll operation. When the enterprise service discovery (ESD) wizard generates the query business object for the user-specified SQL statement, the adapter runs the SQL SELECT statement, and returns data to the database in the structure shown in the following figure.

Figure 2. User-specified SQL business objects
This image is described in the surrounding text.
To process the query business object generated by ESD for the user-specified SELECT statement, the adapter:
  1. Obtains the SELECT SQL statement from the query business object.
  2. Checks whether a dynamic where clause is specified in the query business object.
    • If there is a dynamic where clause, the adapter replaces the default where clause in the SELECT statement with the dynamic one.
    • If there is no dynamic where clause, the adapter replaces parameters in the SELECT statement with the corresponding values specified in the query business object.
  3. Runs the SELECT statement
  4. Obtains the result set that is returned and populates the query business object values with the data returned from the database, creating a container business object with the structure shown in the previous figure.
  5. Does a deep retrieve of each top-level query business object in the container, depending on whether any child business objects are defined for the query business object.
    Note: Query business objects can be only top-level business objects. A query business object cannot have child query business objects.
Related concepts
Create operation
Retrieve operation
Update operation
DeltaUpdate operation
Delete operation
ApplyChanges operation
Execute operation

Terms of use |

Last updated: Tue 12 Dec 2006 03:32:39

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)