Adding Child Tables in Publication Service

To work with parent-child relationships, you have to first add child tables in Publication Service.

When you add a child table, TIBCO ActiveMatrix Adapter for Database (TIBCO Business Studio) creates a class object in the repository for the child table and an association object for the parent-child relationship.

Prerequisites

A source table named CUSTOMER is added in Publication Service. For details on how to add a table in the Schema tab for Publication Service, see Fetching a Table After Creating Publication Service.

Procedure

  1. Click the Schema tab. Select the CUSTOMER table and click Add Child table .
  2. In the "Table name Pattern" window, specify another search criterion, such as ORDER_DETAILS%.
  3. In the "Select table" window, select ORDER_DETAILS from the table list and click Finish.
    A child table ORDER_DETAILS is added to the source table CUSTOMER.
  4. Optional: If you want to add a table from another schema, specify the schema name in the Other Schema field, click Add From Other Schema, and select a table you want.
    To reference an external schema, the default schema must have the proper access privileges. For information on how to grant access privileges to an external schema, see Referencing an External Schema.
  5. Optional: If you click Next in Step 3, you can edit the selected table by selecting or clearing the Use check box next to a table column.
    If the Use check box next to a table column is cleared, the table column is not used. By default, all columns of the table are selected.
  6. Expand the ORDER_DETAILS table and add a join between the CUSTOMER table and ORDER_DETAILS table.
    1. In the ORDER_DETAILS CUSTID entry, select the User Key check box and then click the Join To list.
    2. Select CUSTOMER.CUST_ID from the Join To list and click Save on the toolbar.
    The source table and the child table are joined together.

  7. To add child tables to the ORDER_DETAILS table, repeat Step 3 to Step 6.
    Two child tables, INTERNAL_ORDER_ITEMS and EXTERNAL_ORDER_ITEMS, are added and joined to the ORDER_DETAILS table.