Skip Headers

# Working With Aggregates

Previous

Next

Aggregate mapped objects should never be registered in a TopLink unit of work–doing so will generate an exception. Aggregate cloning and registration is automatic based on the owner of the aggregate object. In other words, if you register the owner of an aggregate, the aggregate is automatically cloned. When you get a working copy of an aggregate owner, its aggregate is also a working copy.

When working with aggregates, you should always use an aggregate within the context of its owner:

- If you get an aggregate from a working clone owner, then the aggregate is a working clone.

- If you get an aggregate from a cache version owner, then the aggregate is the cache version.

For more information about aggregate objects, see "Relational Aggregate Descriptors".