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 Attribute Name

All object-relational mappings map an attribute in a Java object to field in the database. The attribute name is the name of the attribute being mapped. The name is as specified in the reference class (see "Configuring Reference Class").

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

Using Java

Use oracle.toplink.mappings.DatabaseMapping method setAttributeName to specify the name of the attribute being mapped.

Example 50-2 shows how to use this method with a ReferenceMapping that maps the manager attribute of the Employee class.

Example 50-2 Configuring Attribute Name in Java

ReferenceMapping managerMapping = new new ReferenceMapping();
managerMapping.setReferenceClass("Employee.class");
managerMapping.setAttributeName("manager");