Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
Aggregate collection mappings are used to represent the aggregate relationship between a single-source object and a collection of target objects. Unlike the OracleAS TopLink one-to-many mappings, in which there should be a one-to-one back reference mapping from the target objects to the source object, there is no back reference required for the aggregate collection mappings, because the foreign key relationship is resolved by the aggregation.
Caution: The OracleAS TopLink Mapping Workbench does not directly support aggregate collections. You must use an amendment method (see "Amending Descriptors After Loading" on page 4-27) or manually edit the project source to add the mapping. |
To implement an aggregate collection mapping:
The descriptor of the target class must declare itself to be an aggregate collection object. Unlike the aggregate object mapping, in which the target descriptor does not have a specific table to associate with, there must be a target table for the target object.
The descriptor of the source class must add an aggregate collection mapping that specifies the target class.
Aggregate collection descriptors can use inheritance. You must also declare subclasses as aggregate collection. The subclasses can have their own mapped tables, or share the table with their parent class. See "Working with Inheritance" on page 4-39 for more information on inheritance.
In a Java Vector
, the owner references its parts. In a relational database, the parts reference their owners. Relational databases use this implementation to make querying more efficient.
Note: For information on using collection classes other thanVector with aggregate collection mappings, see the Oracle Application Server TopLink Application Developer's Guide.
|