Skip Headers

# Configuring a Relational Descriptor as a Class or Aggregate Type

Previous

Next

By default, when you add a Java class to a relational project (see "Configuring Project Classpath"), TopLink Workbench creates a relational class descriptor for it. A class descriptor is applicable to any persistent object except an object that is owned by another in an aggregate relationship. In this case, you must describe the owned object with an aggregate descriptor. Using a class descriptor, you can configure any relational mapping except aggregate collection and aggregate object mappings.

An aggregate object is an object that is strictly dependent on its owning object. Aggregate descriptors do not define a table, primary key, or many of the standard descriptor options as they obtain these from their owning descriptor. If you want to configure an aggregate mapping to associate data members in a target object with fields in a source object's underlying database tables (see Configuring a Relational Aggregate Collection Mapping and Configuring a Relational Aggregate Object Mapping), you must designate the target object's descriptor as an aggregate.

Alternatively, you can remove the aggregate designation from a relational descriptor and return it to its default type.

You can configure inheritance for a descriptor designated as an aggregate (see "Configuring Inheritance for a Child (Branch or Leaf) Class Descriptor"), however, in this case, all the descriptors in the inheritance tree must be aggregates. Aggregate and class descriptors cannot exist in the same inheritance tree. For more information, see "Aggregate and Composite Descriptors and Inheritance".

If you configure a descriptor as an aggregate, you cannot configure the descriptor with EJB information (see "Configuring a Descriptor With EJB Information").

For more information, see "Descriptors and Aggregation".