Skip Headers

# Using Java

Previous

Next

Use the following `DatabaseMapping` methods to configure the user-defined getters and setters that TopLink will use to access the mapped attribute:

For mappings not supported in TopLink Workbench, use the `setGetMethodName` and `setSetMethodName` methods to access the attribute through user-defined methods, rather than directly.

- `setGetMethodName`–set the `String` name of the user-defined method to get the mapped attribute

- `setSetMethodName`–set the `String` name of the user-defined method to set the mapped attribute

Example: Configuring Access Method in Java shows how to use these methods with a class that has an attribute `phones` and accessor methods `getPhones` and `setPhones` in an object-relational mapping.

Configuring Access Method in Java

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

    // Specify access method
    phonesMapping.setGetMethodName("getPhones");
    phonesMapping.setSetMethodName("setPhones");