WebSphere Adapter for JDBC

Attribute application-specific information

Application-specific information (ASI) for business object attributes differs depending on whether the attribute is a simple attribute, or an attribute that represents a child or an array of child business objects. The application-specific information for an attribute that represents a child differs depending on whether the parent-child relationship is stored in the child or in the parent.

Application-specific information for simple attributes

For simple attributes, the format for application-specific information consists of a number of parameters and their values. The format of attribute application-specific information is shown in the following example section of an .xsd file:

Example .xsd file
            <jdbcasi:ColumnName>pkey</jdbcasi:ColumnName>
            <jdbcasi:PrimaryKey>true</jdbcasi:PrimaryKey>
            <jdbcasi:FixedChar>true</jdbcasi:FixedChar>
         </jdbcasi:JDBCAttributeTypeMetadata>
         </appinfo>
         </annotation>
         <simpleType>
            <restriction base="string">
            <maxLength value="10"/>
            </restriction>
         </simpleType>         
         </element>
         <element name="custCode" type="string">
         <annotation>
         <appinfo source="WBI">
         <jdbcasi:JDBCAttributeTypeMetadata 
         xmlns:jdbcasi="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata">
            <jdbcasi:ColumnName>ccode</jdbcasi:ColumnName>
            <jdbcasi:ForeignKey>custinfoObj/custCode</jdbcasi:ForeignKey>
         </jdbcasi:JDBCAttributeTypeMetadata>
         </appinfo>
         </annotation>         
         </element>
         <element name="firstName" type="string">
         <annotation>
         <appinfo source="WBI">
         <jdbcasi:JDBCAttributeTypeMetadata 
         xmlns:jdbcasi="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata">
            <jdbcasi:ColumnName>fname</jdbcasi:ColumnName>
         </jdbcasi:JDBCAttributeTypeMetadata>
         </appinfo>
         </annotation>         
         </element>
         <element name="lastName" type="string">
         <annotation>
         <appinfo source="WBI">
         <jdbcasi:JDBCAttributeTypeMetadata 
         xmlns:jdbcasi="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata">
            <jdbcasi:ColumnName>lname</jdbcasi:ColumnName>
         </jdbcasi:JDBCAttributeTypeMetadata>
         </appinfo>
         </annotation>         
         </element>

The only required parameter for a simple attribute to be processed by the adapter is the column name. For example, this is the format to specify only the column name, where ccode stands for customer code:

<jdbcasi:ColumnName>ccode</jdbcasi:ColumnName>

The attribute application-specific information parameter that is enabled for use with bidirectional languages is ColumnName. The format of this parameter is transformed based on the attributes set for the BiDiEIS, BiDi.Metadata, BiDiSkip and BiDiSpecialFormat properties. For more information on these properties, see "Adapter configuration properties" in the "Reference" section. For additional information on bidirectional properties, see the bidirectional support general technical paper and the adapter technical paper on the IBM® developerWorks(R) Web site.

When you set attribute application-specific information, specify the parameters listed in the table below.

Table 1. Application-specific information for simple attributes
Parameter Type Description Default value Bidirectional transformation supported
BLOB Boolean Specifies that the database column that corresponds to this attribute is a BLOB data type. While displaying BLOB data, the adapter only displays the number of bytes as a hexadecimal value. The attribute type is hexBinary. None No
ByteArray Boolean If true, the adapter reads and writes binary data to the database and sends that data as a string to the application server. false No
ChildBOType String Specifies the type of complex parameter as either
  • Struct,
  • Array, or
  • ResultSet
None No
ChildBOTypeName String When the value of the ChildBOType application-specific information is either Struct or Array, this parameter value represents the name of the user-defined type.   No
CLOB Boolean Specifies that the database column that corresponds to this attribute is a CLOB data type. Only applicable for String attribute type.
Note: A CLOB data type is defined as follows:
  • The CLOB attribute has a String Type whose length is used to define the length of the CLOB.
  • The CLOB attribute has ASI CLOB=true.
None No
ColumnName String The name of the database column for this attribute. None Yes
DateType String Specifies that the corresponding element be treated as Date, Time or TimeStamp type. The DateType parameter has the actual value stored against it, for example,
  • <DateType>Date</DateType>
  • <DateType>Time</DateType>
  • <DateType>TimeStamp</DateType>
When setting these values use the following formats:
  • For Date use yyyy-mm-dd
  • For Time use hh:mm:ss
  • For TimeStamp use yyyy-mm-dd hh:mm:ss
None No
FixedChar Boolean

Specifies whether the attribute is of fixed length when the columns in the table are of type CHAR, not VARCHAR. For example, if a particular attribute is linked to a column that is of type CHAR, the adapter pads the attribute value with blanks to the maximum length of the attribute when querying the database.

This parameter needs to be updated manually in the business object .xsd file. You can edit the file either in text mode or by using the Business Object Editor in WebSphere® Integration Developer. Ensure that no validation errors occur in the .xsd after it has been updated. See the code example for this parameter following this table.

false No
ForeignKey String The value of this property depends on whether the parent/child relationship is stored in the parent business object or in the child.

If it is stored in the parent, set the value to include both the type of the child business object and the name of the attribute in the child to be used as the foreign key (Child_BO_name/Child_Property_Name).

If it is stored in the child, set the value to include only the name of the attribute in the parent to be used as the foreign key.

If an attribute is not a foreign key, do not include this parameter in the application-specific information.

None No
OrderBy String If a value is specified for this parameter and the attribute is in a child business object, the adapter uses the value of the attribute in the ORDER BY clause of retrieval queries. The adapter can retrieve child business objects in either ascending order (ASC) or descending order (DESC). If you do not include this parameter in the application-specific information, the adapter does not use this attribute when specifying retrieval order. None No
PrimaryKey Boolean If the value is true, this implies that the column associated with this attribute is a primary key in the corresponding table in the database. None No
SPParameterType String Specifies the type of stored procedure Parameter: IP (input only), OP (output only), IO (input and output), or RS (result set). None No
UniqueIdentifier (UID) String The adapter uses this parameter to generate the unique ID for the business object. It supports the generation of sequences and identity columns (UID=AUTO|Sequence_Name). Sequences can be defined for DB2® and Oracle databases only. Identity columns can be defined for DB2 and Microsoft® SQL Server. If the attribute does not require a unique ID, do not include this parameter in the application-specific information. None No

Example of FixedChar parameter in the business object .xsd file

<element name="primaryKey">
<annotation>
<appinfo source="WBI">
        <jdbcasi:JDBCAttributeTypeMetadata 
xmlns:jdbcasi="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata">
                <jdbcasi:ColumnName>pkey</jdbcasi:ColumnName>
                <jdbcasi:PrimaryKey>true</jdbcasi:PrimaryKey>
                <jdbcasi:FixedChar>true</jdbcasi:FixedChar>
        </jdbcasi:JDBCAttributeTypeMetadata>
</appinfo>
</annotation>
<simpleType>
        <restriction base="string">
                <maxLength value="10"/>
        </restriction>
</simpleType>                
</element>

Application-specific information for attributes of type child business object

Two application-specific information parameters are used for attributes that refer to child business objects (non-simple attributes). When you set this application-specific information, specify the parameters listed in the table below.

Table 2. Application-specific information for attributes of type child business object
Parameter Type Description Default value Bidirectional transformation supported
KeepRelationship Boolean If true, this parameter prevents the deletion of a child business object during an Update operation. None No
Ownership Boolean This parameter specifies that a child business object is owned by the parent. If true, then Create, Update, and Delete operations on the child business object are allowed. If false, then none of these updates can be applied to the child business object. When its parent is created, the existence of the child is validated to ensure that relationship integrity is maintained in the database. None No

Example of OWNERSHIP in the business object .xsd file

<element minOccurs="0" name="addressObj" type="bons0:OutboundRtasserAddress"
maxOccurs="unbounded"> <annotation> <appinfo source="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata"> <jdbcasi:JDBCAttributeTypeMetadata xmlns:jdbcasi=
"http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata"> <jdbcasi:Ownership>true</jdbcasi:Ownership> </jdbcasi:JDBCAttributeTypeMetadata> </appinfo> </annotation> </element> <element minOccurs="0" name="custinfoObj" type="bons1:OutboundRtasserCustinfo"
maxOccurs="1"> <annotation> <appinfo source="http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata"> <jdbcasi:JDBCAttributeTypeMetadata xmlns:jdbcasi=
"http://www.ibm.com/xmlns/prod/websphere/j2ca/jdbc/metadata"> <jdbcasi:Ownership>false</jdbcasi:Ownership> </jdbcasi: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)