Skip Headers

# Configuring Read-Only Mappings

Previous

Next

Mappings that are read-only will not be affected during insert, update, and delete operations.

Use read-only mappings when multiple attributes in an object map to the same fields in the database but only one of the mappings can write to the field.

You can also use read-only mappings with bi-directional many-to-many mappings to designate which mapping will be responsible for updating the many-to-many join table.

Note: The primary key mappings cannot not be read-only.

Mappings defined for the write-lock or class indicator field must be read-only, unless the write-lock is configured not to be stored in the cache or the class indicator is part of the primary key.

Use read-only mappings only if specific mappings in a descriptor are read-only. If the entire descriptor is read-only, use the descriptor-level setting (see "Configuring Read-Only Descriptors").

Table: Mapping Support for Read-Only summarizes which mappings support this option.

Mapping Support for Read-Only

Mapping | Using TopLink Workbench | Using Java
--- | --- | ---
Relational Mappings |  |
Object-Relational Mappings |  |
EIS Mappings |  |
XML Mappings |  |