Skip Headers

# Configuring Reading Subclasses on Queries

Previous

Next

If you are mapping an inheritance hierarchy, by default, queries on root or branch classes return instances of the root class only.

Alternatively, you can configure a root or branch class descriptor to include subclasses when the root or branch class is queried.

You can also specify a database view to optimize the reading of subclasses. The view can be used to optimize queries for root or branch classes that have subclasses spanning multiple tables. The view must apply an outer-join or union all of the subclass tables.

Do not configure this option for leaf classes.

Table: Descriptor Support for Inherited Attribute Mapping Configuration summarizes which descriptors support inherited attribute mapping configuration.

Descriptor Support for Inherited Attribute Mapping Configuration

Descriptor | Using TopLink Workbench | Using Java
--- | --- | ---
Relational Descriptors |  |
Object-Relational Descriptors |  |
EIS Descriptors |  |
XML Descriptors |  |

For more information, see "Descriptors and Inheritance".