WebSphere Adapter for JDBC

Linking business objects in a parent-child relationship

After generating artifacts, you need to link the Customer and Address business objects in a parent-child relationship. You will provide additional application-specific information to support the linking of the objects.

How to perform this task

  1. Under Data Types, double-click AddcuserCustomer to open the business object in business object designer.
  2. Click the icon for Add an attribute to a business object.
    Figure 1. Add an attribute to the business object
    This screen capture is described in the surrounding text.

    This creates a new attribute called attribute1, whose type is the AddcuserAddress object.

  3. Rename this new attribute by typing addrObj.
  4. Change the type of the attribute by clicking on the string type. A list of types that can be associated with this attribute is displayed. Select the AddcuserAddress type.
    Figure 2. Change type of attribute
    This screen capture is described in the surrounding text.
  5. Indicate this Address child object is a multiple cardinality type; that is, one Customer object can have multiple Address objects.
    1. Select the new attribute addrObj AddcuserAddress.
    2. In the Properties tab, click Description.
    3. Select the Array checkbox.
      Figure 3. Check Array for multiple cardinality
      This screen capture is described in the surrounding text.
  6. Add the attribute application-specific information for the addrObj AddcuserAddress attribute.
    1. In the Properties tab, click Application Info.
    2. Select the JDBCAttributeTypeMetadata check box to add attribute application-specific information to the newly added attribute.
      Figure 4. Add attribute application-specific information
      This screen capture is described in the surrounding text
    3. Under ASI element properties, right-click jdbcasi: JDBCAttributeTypeMetadata. Select Add Child > jdbcasi:Ownership.
      Figure 5. ASI element properties
      This screen capture is described in the surrounding text.
    4. Use the default value of true for jdbcasi:Ownership. By setting the ownership value to true, you indicate that the parent owns the child; that is, the child cannot exist without the parent.
    5. Click Save to save the Customer business object.
      Figure 6. Set ownership
      This screen capture is described in the surrounding text.
  7. Set the foreign key on the AddcuserAddress business object.
    1. Under Data Types, double-click AddcuserAddress to open this business object in business object designer.
    2. Click the custid attribute.
    3. In the Properties tab, click Application Info.
    4. Right-click jdbcasi:JDBCAttributeTypeMetadata. Select Add Child > jdbcasi: ForeignKey. Type the value pkey.

      The pkey value represents the attribute in the Customer object that refers to the primary key in the Customer table.

      Figure 7. Set foreign key
      This screen capture is described in the surrounding text.

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)