84 Configuring an EIS One-to-Many Mapping

This chapter describes the various components that you must configure in order to use an EIS one-to-many mapping.

This chapter includes the following sections:

For information on how to configure TopLink mappings options common to two or more mapping types, see Chapter 121, "Configuring a Mapping".

For information on how to create TopLink mappings, see Chapter 120, "Creating a Mapping".

Table 84-1 lists the configurable options for an EIS one-to-one mapping.

84.1 Introduction to EIS One-to-Many Mapping Configuration

Table 84-1 lists the configurable options for an EIS one-to-many mapping.

Table 84-1 Configurable Options for EIS One-to-Many Mappings

Option to Configure Oracle JDeveloper
TopLink Workbench
Java

Reference descriptors (see Section 78.3, "Configuring Reference Descriptors")

Supported Supported Supported

Foreign key pairs (see Section 84.2, "Configuring Foreign Key Pairs")

Supported Supported Supported

Bidirectional relationship (see Section 121.18, "Configuring Bidirectional Relationship")

Supported Supported Supported

Method or direct field access at the mapping level (see Section 121.6, "Configuring Method or Direct Field Accessing at the Mapping Level")

Supported Supported Supported

Read-only mappings (see Section 121.2, "Configuring Read-Only Mappings")

Supported Supported Supported

Private or independent relationships (see Section 121.7, "Configuring Private or Independent Relationships")

Supported Supported Supported

Indirection (lazy loading) (see Section 121.3, "Configuring Indirection (Lazy Loading)")

Supported Supported Supported

Container policy (see Section 121.14, "Configuring Container Policy")

Supported Supported Supported

Mapping comments (see Section 121.8, "Configuring Mapping Comments")

Supported Supported Supported

Selection interaction (see Section 78.4, "Configuring Selection Interaction")

Supported Supported Supported

Delete all interactions (see Section 84.3, "Configuring Delete All Interactions")

Supported Supported Supported

For more information, see the following:

84.2 Configuring Foreign Key Pairs

In a one-to-many EIS mapping, you relate a source object attribute to a target object attribute by specifying one or more pairs of source and target object fields.

In a one-to-many EIS mapping with key on source (see Section 77.8.1, "EIS One-to-Many Mappings with Key on Source") using XML records, TopLink puts the target XML field value into the source object's record as a simple value. By default, these values are not grouped, as Example 84-1 shows.

Example 84-1 Source Object XML Record without Grouping

<employee>
    <name>Jane</name>
    <project-id>3</project-id>
    <project-id>4</project-id>
</employee>

If you specify more than one source and target XML field pair, you must specify a grouping element, as Example 84-2 shows.

Example 84-2 Source Object XML Record with Grouping

<employee>
    <name>Jane</name>
    <project>
        <project-id>3</project-id>
        <project-name>Project 3</project-name>
    </project>
    <project>
        <project-id>4</project-id>
        <project-name>Project 4</project-name>
    </project>
</employee>

In a one-to-one EIS mapping with key on target (see Section 77.8.2, "EIS One-to-Many Mappings with Key on Target") using XML records, TopLink uses the source XML field value in the selection interaction to acquire the appropriate instances of target object.

84.2.1 How to Configure Foreign Key Pairs Using TopLink Workbench

To specify the source and target XML field pairs for a one-to-many EIS mapping, use this procedure:

  1. Select the one-to-one EIS mapping in the Navigator. Its properties appear in the Editor.

  2. Click the General tab. The General tab appears.

    Figure 84-1 Foreign Keys Field on General Tab

    Description of Figure 84-1 follows
    Description of "Figure 84-1 Foreign Keys Field on General Tab"

Use the following information to complete the Foreign Keys fields on the General tab:

Field Description
Foreign Keys Located On Target Select if you are creating a one-to-many EIS mapping with key on target (see Section 77.8.2, "EIS One-to-Many Mappings with Key on Target").
Foreign Keys Located On Source Select if you are creating a one-to-many EIS mapping with key on source (see Section 77.8.1, "EIS One-to-Many Mappings with Key on Source").
    Grouping Element Specify the element in which foreign key pairs are grouped in the source object's EIS record.

If you specify only one pair of source and target XML fields, this is optional.

If you specify more than one pair of source and target XML fields, this is required.

    Field Pairs Click Add to add a pair of source and target XML fields.

Specify Field Pair dialog box opens. Click Browse to add a foreign key for the Source XPath and Target XPath fields.


84.3 Configuring Delete All Interactions

The TopLink query and expression framework supports delete all queries. If your JCA adapter provides access to an EIS Delete All function, you can configure a delete all interaction to support TopLink delete all queries.

84.3.1 How to Configure Delete All Interactions Using TopLink Workbench

To specify the DeleteAll interaction for an EIS one-to-many mapping, use this procedure:

  1. Select the mapped attribute in the Navigator. Its properties appear in the Editor.

  2. Click the Delete All Interaction tab. The Delete All Interaction tab appears.

    Figure 84-2 Delete All Interaction Tab

    Description of Figure 84-2 follows
    Description of "Figure 84-2 Delete All Interaction Tab"

Use the following information to enter data in each field on the Delete All Interaction tab:

Field Description
Function Name The name of the EIS function that this call type (Read Object or Read All) invokes on the EIS.
Input Record Name The name passed to the JCA adapter when creating the input record.
Input Root Element Name The root element name to use for the input DOM.
Input Arguments The query argument name to map to the interaction field or XPath nodes in the argument record.

For example, if you are using XML records, use this option to map input argument name to the XPath name/first-name.

Output Arguments The result record field or XPath nodes to map to the correct nodes in the record used by the descriptor's mappings.

For example, if you are using XML records, use this option to map the output fname to name/first-name.

Output arguments are not required if the interaction returns an XML result that matches the descriptor's mappings.

Input Result Path Use this option if the EIS interaction expects the interaction arguments to be nested in the XML record.

For example, specify arguments, if the arguments were to be nested under the root element exec-find-order, then under an arguments element.

Output Result Path The name of the EIS function that this call type (Read Object or Read All) invokes on the EIS.
Properties Any properties required by your EIS platform. For example, property name operation (from AQPlatform.QUEUE_OPERATION) and property value enqueue (from AQPlatform.ENQUEUE).