Skip Headers

# Aggregate and Composite Descriptors in Relational Projects

Previous

Next

In a relational project, you can designate the descriptor as an aggregate (see "Relational Aggregate Descriptors").

This lets you configure an aggregate mapping (see Configuring a Relational Aggregate Object Mapping) to associate data members in the target object with fields in the source object's underlying database tables.

When you designate a relational descriptor as an aggregate, TopLink lets you specify a mapping type for each field in the target class, but defers associating the field with a database table until you configure the aggregate object mapping in the source descriptor. In other words, the target class descriptor defines how each target class field is mapped, but the source class descriptor defines where each target class field is mapped. This lets you share an aggregate object among many parent descriptors mapped to different tables.

When you designate a relational descriptor as an aggregate, you tell TopLink that the class will be a target of an aggregate object mapping, and this ensures that the TopLink runtime handles the target class as follows:

- It inserts, updates, and deletes the target class in parallel with its source class.

- It does not cache the target class on its own; instead, it caches the target class as part of its source class.

- It does not allow the target class to be read, written, deleted, or registered in a unit of work.

When working with aggregate relational descriptors, consider the following:

- Relational Aggregates and Nesting

- Relational Aggregates and Inheritance

- Relational Aggregates and EJB

For more information, see "Configuring a Relational Descriptor as a Class or Aggregate Type".