Skip Headers

# Aggregate Object Mappings With Multiple Source Objects

Previous

Next

Figure: Aggregate Object Mapping with Multiple Source Objects shows an example aggregate object mapping in which different source objects–`Employee` and `Project`–map instances of the same type of target object, `Period`.

Aggregate Object Mapping with Multiple Source Objects

Description of "Aggregate Object Mapping with Multiple Source Objects "

When you configure the aggregate object mapping in the source object, you choose the source object table for that particular mapping. This allows different source types to store the same target information within their tables. Each source object's table may use different field names. TopLink automatically manages the case where multiple source object tables use different field names.

For example, in Figure: Aggregate Object Mapping with Multiple Source Objects, The `Employee` attribute `employPeriod` is mapped by an aggregate object mapping to target object `Period`. This mapping associates `Period` attribute `startDate` with `EMPLOYEE` table field `START_DATE`. The `Project` attribute `projectPeriod` is also mapped by an aggregate object mapping to target object `Period`. This mapping associates `Period` attribute `startDate` with `PROJECT` table field `S_DATE`.

Aggregate target classes shared with multiple source classes cannot have one-to-many or many-to-many mappings.