Skip Headers
Oracle TopLink Developer's Guide
10g Release 3 (10.1.3)
B13593-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Configuring Field Name

All object-relational mappings require the name of database field to which their specified attribute is mapped. This field name can be the column name of a database table or the name of a field in an object type created on the database.

Table 50-5 summarizes which object-relational mappings support this option.

Using Java

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

Example 50-3 shows how to use this method with an ObjectArrayMapping that maps the Employee class attribute phone to database field name PHONE_NUMBER.

Example 50-3 Configuring Field Name in Java

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