Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Configuring Mapped Field Access at the Project Level

By default, when TopLink performs a persistence operation, it accesses the persistent attributes of an object directly: this is known as direct field access. Alternatively, you can configure TopLink to access persistent attributes using accessor methods of the object: this is known as method access.

Oracle recommends using field access for mappings. Not only is it more efficient, but using method access may cause issues if the method produces unexpected side-effects.

Table 22-5 summarizes which projects support mapped field access configuration.

Table 22-5 Project Support for Mapped Field Access

Descriptor | Using TopLink Workbench | Using Java
--- | --- | ---
Relational Projects |  |
EIS Projects |  |
XML Projects |  |

This section describes configuring mapped field access at the project level: by default, this configuration applies to all descriptors and their mappings.

Note: If you change the access default, existing mappings retain their current access settings, but new mappings will be created with the new default.

You can also configure mapped field access at the mapping level to override this project-level configuration on a mapping-by-mapping basis. For more information, see "Configuring Method Accessing".

## Using TopLink Workbench

To specify the field access method information, use this procedure:

1. Select the project object in the Navigator.

2. Select the Defaults tab in the Editor. The Defaults tab appears.

   Figure 22-3 Defaults Tab, Field Accessing Options

   Description of "Figure 22-3 Defaults Tab, Field Accessing Options"

Use this table to enter data in the following fields of the tab to specify the default field access method for newly created descriptors:

Field | Description
--- | ---
Method Accessing | Use Method Accessing as the default field access method.
Direct Field Accessing | Use Direct Field Accessing as the default field access method.