Skip Headers

# Using Java

Previous

Next

Use the following `DatabaseMapping` methods to configure the read access of a mapping:

- `readOnly`–configures mapping read access to read-only

- `readWrite`–configures mapping read access to read and write (default)

Example: Configuring Read Only Mappings in Java shows how to use these methods with a class that has a read-only attribute named `phones`.

Configuring Read Only Mappings in Java

    // Map the phones attribute
    phonesMapping.setAttributeName("phones");

    // Specify read-only
    phonesMapping.readOnly();