Defining lookup relationships

A lookup relationship associates data that is equivalent across business objects but may be represented in different ways. In this case, given a value in one business object, the relationship can look up its equivalent in the relationship tables for another business object. The most common example of attributes that might require lookups are codes (EmployeeType, PayLevel, OrderStatus) and abbreviations (State, Country, Currency). For more background information, see "Lookup relationships".

When you create a relationship definition for a lookup, you add a participant definition for each business object that contains the attributes you want to relate. However, you do not associate the actual business object definitions or attribute names with the participant definitions. Instead, you specify Data as the participant type for each participant definition.

To define a lookup relationship using Relationship Designer Express, perform the following steps:

  1. Create a relationship definition and the participant definitions by following Steps 1-4 in "Creating relationship definitions".

    Create a participant definition for each business object to be related.

  2. For each participant definition, specify Data as the participant type by dragging the Data participant type from the Participant Types window onto the participant definition.

    In the relationship definition, the Data participant type represents all data types other than business object types. When you create the map and work with instances of the relationship using methods in the Relationship, IdentityRelationship, and Participant classes, you can use data of any of the supported Java data types, such as String, int, long, float, double, or boolean.

  3. Make a note of the table name for storing the lookup values for each participant definition. You need to know the table name so you can populate the tables with the lookup values for each participant definition. Or, if you already have tables containing the lookup values, you can replace the generated table name with your own table name.

    To retrieve the table names for each participant definition in the relationship definition, or to specify your own table names:

    1. Select the participant definition and select Advanced Settings from the Edit menu.

      Result: The Advanced Setting dialog box appears showing the storage settings for that participant. See "Specifying advanced relationship settings" for more information on these settings.

    2. Write down the storage settings for the participant, or overwrite the settings with your own table information.



      Figure 95. Advanced Settings dialog

    3. Repeat step 3a and step 3b for each participant definition.
    4. Click OK to close the Advanced Settings dialog box.
  4. Save the relationship definition as described in steps 7-8 in "Creating relationship definitions".

    To create the relationship tables, check the Create Schema box in the Deploy Project dialog in System Manager. For more information about when to create the run-time schema, see"Creating the relationship table schema".

  5. Using the information you gathered in step 3, populate the relationship tables with the lookup values for each participant, or add your own tables of lookup values to the database. For more information, see "Populating lookup tables with data".

Copyright IBM Corp. 1997, 2003