29 Configuring a Relational Direct-to-Field Mapping

This chapter describes the various components that you must configure in order to use a relational direct-to-field mapping.

This chapter includes the following section:

For information on how to configure TopLink mappings options common to two or more mapping types, see Chapter 121, "Configuring a Mapping".

For information on how to create TopLink mappings, see Chapter 120, "Creating a Mapping".

Table 29-1 lists the configurable options for a relational direct-to-field mapping.

29.1 Introduction to Relational Direct-to-Field Mapping Configuration

Table 29-1 lists the configurable options for a relational direct-to-field mapping.

Table 29-1 Configurable Options for Relational Direct-to-Field Mapping

Option to Configure Oracle JDeveloper
TopLink Workbench
Java

Database field (see Section 28.3, "Configuring a Database Field")

Supported.

Supported Supported

Method or direct field access (see Section 121.6, "Configuring Method or Direct Field Accessing at the Mapping Level")

Supported.

Supported Supported

Default null value (see Section 121.5, "Configuring a Default Null Value at the Mapping Level")

Supported.

Supported Supported

Read-only (see Section 121.2, "Configuring Read-Only Mappings")

Supported.

Supported Supported

Mapping comments (see Section 121.8, "Configuring Mapping Comments")

Supported.

Supported Supported

Serialized object converter (see Section 121.9, "Configuring a Serialized Object Converter")

Supported.

Supported Supported

Type conversion converter (see Section 121.10, "Configuring a Type Conversion Converter")

Supported.

Supported Supported

Object type converter (see Section 121.11, "Configuring an Object Type Converter")

Supported.

Supported Supported

Example 29-1 shows how to create a direct-to-field mapping and add it to a descriptor using Java code.

Example 29-1 Direct-to-Field Mapping

public void customize(ClassDescriptor descriptor) { 
    DirectToFieldMapping mapping = new DirectToFieldMapping();  

    // configure mapping
    ...   

    // add mapping to descriptor
    descriptor.addMapping(mapping);
}

For more information, see the following: