Skip Headers

# Using Java

Previous

Next

Use the object-relational mapping method `setFieldName` to specify the database field to which the attribute is mapped.

Example: Configuring Field Name in Java shows how to use this method with an `ObjectArrayMapping` that maps the `Employee` class attribute `phone` to database field name PHONE_NUMBER.

Configuring Field Name in Java

    ObjectArrayMapping phonesMapping = new ObjectArrayMapping();
    managerMapping.setReferenceClass("Employee.class");
    phonesMapping.setAttributeName("phone");
    phonesMapping.setFieldName("PHONE_NUMBER");