IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > JDBC > Overview of IBM WebSphere Adapter for JDBC > Technical overview > Outbound processing > Outbound operations

Retrieve operation

The Retrieve operation extracts data from a database for a hierarchy of business objects.

To process the Retrieve operation, the adapter performs the following actions:

  1. Removes all child business objects from the top-level business object it received. In other words, it makes a copy of the top-level business object without any children.
  2. Retrieves the top-level business object from the database. Because the Retrieve operation uses only the primary key, the primary key must be provided for the top-level business object. Other columns are ignored.

    Only the primary key provided in top-level business is used to construct the WHERE clause in the SQL statement.

    • If the top-level business object is a wrapper business object, it is ignored. No retrieval is performed for wrapper business objects.

    • If the retrieval returns one row, the adapter continues processing.

    • If the retrieval returns no rows, indicating that the top-level business object does not exist in the database, the adapter returns the RecordNotFoundException error.

    • If the retrieval returns more than one row, the adapter returns the MultipleMatchingRecordsException error.

  3. Recursively retrieves all multiple-cardinality child business objects.

    The adapter does not enforce uniqueness when populating an array of business objects. It is the databases responsibility to ensure uniqueness. If the database returns duplicate child business objects, the adapter returns duplicate children.

  4. Recursively retrieves each of the single-cardinality children, regardless of whether the child business object is contained with or without ownership. The ownership attribute is ignored. The adapter uses the foreign key in the top-level business object to retrieve the child business object. All values configured in the child business object are ignored. If a foreign key is configured in the top-level business object and no records are found in the child business object, the operation returns a null business object.

    The single-cardinality child business objects are processed based on their order of occurrence in the business object and after the parent business object is processed.


Retrieving NULL data

The adapter can retrieve a record from a database table when the column value is NULL.

For example, a Customer business object might have these columns: custid, ccode, fname, and lname, where custid and ccode form composite keys. Composite keys are primary keys that refer to more than one attribute and are used to define the uniqueness of the business object. You can retrieve a Customer record for which ccode is NULL. The adapter generates a SELECT statement for the Retrieve operation as:

select custid, ccode, fname, lname from customer where custid=? and ccode is NULL

For more information about null data, see Null Data - Frequently Asked Questions.

Outbound operations


Related concepts:

Create operation

RetrieveAll operation

Update operation

UpdateAll operation

ApplyChanges operation

Delete operation

DeleteAll operation

Execute operation

Exists operation

Upsert operation

Batch operations


Related reference:

Fault business objects