Skip Headers
Oracle® TopLink Developer's Guide
10g Release 3 (10.1.3.1.0)

Part Number B28218-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

43 Configuring a Relational Aggregate Object Mapping

This chapter describes the various components that you must configure in order to use a relational aggregate object mapping.


Note:

You configure the relational aggregate object mapping in the source object's descriptor. However, before doing so, you must designate the target object's descriptor as an aggregate (see "Configuring a Relational Descriptor as a Class or Aggregate Type").

For more information, see the following:

Table 43-1 lists the configurable options for a relational aggregate object mapping.

Relational Aggregate Object Mapping Configuration Overview

Table 43-1 lists the configurable options for a relational aggregate object mapping.

Table 43-1 Configurable Options for Relational Aggregate Object Mapping

Option Type TopLink Workbench
Java

"Configuring Reference Descriptor"


Basic

Supported
Supported

"Configuring Method Accessing"


Advanced

Supported
Supported

"Configuring Read-Only Mappings"


Advanced

Supported
Supported

"Configuring Allowing Null Values"


Advanced

Supported
Supported

"Configuring Mapping Comments"


Advanced

Supported
Unsupported.

"Configuring Aggregate Fields"


Basic

Supported
Supported

Configuring Aggregate Fields

When you designate a descriptor as an aggregate, TopLink allows you to 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 class 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 section explains how to configure the source class descriptor to define where each target class field is mapped.

For more information on how to configure the target class descriptor to define how each target class field is mapped, see "Configuring a Relational Descriptor as a Class or Aggregate Type".

Using TopLink Workbench

To specify the mapped fields of an aggregate mapping, use this procedure.

Use the following information to complete each field on the tab:

Field Description
Field Description This column shows the name of the fields from the target object, whose descriptor is designated as an aggregate (see "Configuring a Relational Descriptor as a Class or Aggregate Type"). These are for display only and cannot be changed.
Fields Use this column to select the source object database table field that TopLink will map to the corresponding target object field.

Configuring Allowing Null Values

If all the fields in the database row for the aggregate object are null, then, by default, TopLink places null in the appropriate source object, as opposed to filling an aggregate object with null values.

Using TopLink Workbench

To allow a mapping to contain a null value, use this procedure.

  1. Select the mapped attribute in the Navigator. Its properties appear in the Editor.

  2. Click the General tab. The General tab appears.

    Figure 43-1 General Tab, Allow Null Option

    Description of Figure 43-1 follows
    Description of "Figure 43-1 General Tab, Allow Null Option"

Select the Allows Null option to allow this mapping to contain a null value.