Skip Headers

# Configuring Foreign Key Pairs

Previous

Next

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 "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: Source Object XML Record without Grouping shows.

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: Source Object XML Record with Grouping shows.

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 "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.