Working with Aggregate Collection Mappings

Aggregate collection mappings are used to represent the aggregate relationship between a single-source object and a collection of target objects. Unlike the 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 TopLink Mapping editor does not directly support aggregate collections. You must use an amendment method or manually edit the project source to add the mapping.

To implement an aggregate collection mapping:

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. For more information on inheritance, see "Working with 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 than Vector with aggregate collection mappings, see the book OracleAS TopLink Application Developer's Guide.

Related Topics

About TopLink Mapping Types
Working with Relationship Mappings

 

Copyright © 1997, 2004, Oracle. All rights reserved.