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 Reference Class

When mapping an attribute that involves a relationship to another class, you must specify the reference class–the Java class to which the mapped attribute refers.

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

Using Java

Use oracle.toplink.mappings.ForeignReferenceMapping method setReferenceClass to specify the target class of the attribute being mapped.

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

Example 50-1 Configuring Reference Class in Java

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