WebSphere Adapter for JDBC

Business object attributes and their application-specific information

The attributes of a business object are built from the list of columns in the database object. The enterprise service discovery wizard sets the attribute name to the name of the column. Globalized characters are supported in the attribute names. The adapter adds the attribute name, type, and application-specific information.

The types returned by the JDBC metadata are mapped to the business object attribute types as listed in the table "JDBC metadata column and business object attribute types." Only the JDBC types listed are supported by the adapter. Any columns with types not listed are not added to the business object. An informational message is produced stating, for example, The column named xxxx in the table named yyyy is not of a supported type and will not be added to the business object.

Table 1. JDBC metadata column and business object attribute types
JDBC metadata column type Business object attribute type
BIT BOOLEAN

CHAR  
LONGVARCHAR  
VARCHAR

STRING

INTEGER
NUMERIC
SMALLINT  
TINYINT  
BIGINT

INT

TIME  
TIMESTAMP  
DATE

STRING
DECIMAL STRING
DOUBLE
FLOAT
DOUBLE
REAL FLOAT
BLOB HEXBINARY
CLOB STRING
BINARY
VARBINARY
LONGBINARY
HEXBINARY

The table titled "Attribute information" lists the attribute information set by the enterprise service discovery wizard.

Table 2. Attribute information
Attribute information Set by enterprise service discovery Additional information
Cardinality No In both single- and multiple-cardinality relationships, the relationship between the parent and child business objects is described by the application-specific information of the key attribute in the business object storing the relationship.
MinOccurs/MaxOccurs Yes If the column is not a primary key and is not nullable, the attribute is required, and the values for the attribute will be set to at least 1.
Name Yes Name of the attribute. This is enabled for bidirectional languages.
Type Yes Set as shown in the table titled "JDBC metadata column and business object attribute types."

The enterprise service discovery wizard sets the attribute application-specific information (ASI) in the business object as shown in the table titled "Attribute application-specific information." For more information, see "Attribute application-specific information."

Table 3. Attribute application-specific information
Attribute ASI Set by enterprise service discovery Additional information Bidirectional transformation supported
BLOB Yes Set to true if the column data type is BLOB. No
ByteArray No Set to true for columns of binary data types. If true, the adapter reads and writes binary data from and to the database. The adapter sets binary data on the business object. The attribute type is hexBinary. No
ChildBOType Yes If the attribute is a complex data type, specify the type as Struct, Array or ResultSet. No
ChildBOTypeName Yes When the value of ChildBOType is Struct or Array, this value represents the name of the user-defined type. No
CLOB Yes Set to true if the column data type is CLOB. No
ColumnName Yes Set to the actual name of the column. Yes
DateType Yes Value can be only Date, Time or TimeStamp. No
FixedChar No Needs to be updated manually in the business object .xsd file. Use either text mode or the Business Object Editor in WebSphere® Integration Developer to edit the file. After updating the file, ensure there are no validation errors. See an example of FixedChar in an .xsd file in the section "Application-specific information for simple attributes." No
ForeignKey No For foreign key attributes, if the parent-child relationship is stored in the parent, the value of this parameter includes both the type of the child business object and the name of the attribute in the child to be used as the foreign key. If the relationship is stored in the child, the value includes only the name of the attribute in the parent to be used as the foreign key. No
OrderBy No If a value is specified, and the attribute is in a child business object, the adapter uses the value of the attribute in the ORDER BY clause of retrieval entries. No
PrimaryKey Yes If the column is a primary key, PrimaryKey is set to true. No
SPParameterType Yes If the attribute is associated with a stored procedure parameter, set the value to the actual parameter type, either IP, OP or IO. No
UID No Used when the attribute requires a unique ID for the business object. It supports the generation of sequences and identity columns. No
Table 4. Attribute application-specific information for attributes of type child business object
Attribute ASI Set by enterprise service discovery Additional information Bidirectional transformation supported
KeepRelationship No Prevents deletion of a child business object during an Update operation when the parameter is set to true. No
Ownership No Allows Create, Update and Delete operations on the child business object when the parameter is set to true. No

If you choose to add stored procedures to the business objects, the verb application-specific information (ASI) is set as specified in the table titled "Verb application-specific information." For information on valid stored procedure types, see the section "Verb application-specific information."

Table 5. Verb application-specific information
Verb ASI or Stored procedure parameters element Set by enterprise service discovery Additional information Bidirectional transformation supported
Parameters Yes Lists the stored procedure parameters. Yes
PropertyName Yes Set to the name of the business object attribute that you select. For more information, see "Object selection and generation." Yes
ResultSet No If the stored procedure returns a ResultSet, set this parameter to true in the business object definition. No
ReturnValue Yes If the stored procedure has a return value, this parameter is set to RS or a business object attribute's name. For more information, see "Object selection and generation." No
StoredProcedure Yes Set to the stored procedure name. Yes
StoredProcedure Type Yes You choose from a list of types. No
Type Yes Set to the type of the stored procedure parameter, either IP, OP, IO, or RS. No

To build hierarchical business objects

The enterprise service discovery wizard generates flat table and view business objects. It does not use the foreign key constraints that are defined in the database between different tables to build relationships automatically. These need to be linked manually. You can update the business object definitions either in text mode or by using the Business Object Editor. The enterprise service discovery wizard generates the hierarchy for stored procedure business objects automatically.

An example of the .xsd definition file for single- and multiple-cardinality child business objects is provided here. The element custInfoObj is a single-cardinality child business object, and addressObj is a multiple-cardinality child business object.

Example .xsd file for single- and multiple-cardinality child business objects

<element name="addressObj" minOccurs="1" type="Address:Address" 
maxOccurs="unbounded"> 
                        <annotation>
                        <appinfo source="WBI">
                        <pasi:JDBCAttributeTypeMetadata xmlns:pasi=
"urn:app:jdbc:asi">
                                <pasi:Ownership>true</pasi:Ownership>
                        </pasi:JDBCAttributeTypeMetadata>
                        </appinfo>
                        </annotation>
                        </element>
                        <element name="custInfoObj" minOccurs="0" type=
"CustInfo:CustInfo" maxOccurs="1"> 
                        <annotation>
                        <appinfo source="WBI">
                        <pasi:JDBCAttributeTypeMetadata xmlns:pasi=
"urn:app:jdbc:asi">
                                <pasi:Ownership>false</pasi:Ownership>
                        </pasi:JDBCAttributeTypeMetadata>
                        </appinfo>
                        </annotation>
                        </element>        

Terms of use |

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

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