|
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
Use a many-to-one mapping to represent simple pointer references between two Java objects. In Java, a single pointer stored in an attribute represents the mapping between the source and target objects. Relational database tables implement these mappings using foreign keys.
You define a many-to-one mapping at one of the property (getter or setter method) or field level of your entity.
For more information, see "Understanding One-to-One Mapping" in the Oracle TopLink Developer's Guide.
|
Note: For an EJB 3.0 basic mapping code example, see:http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb30mappingannotations/doc/how-to-ejb30-mapping-annotations.html#manytoone.
|
Example 7-17 shows how to use the @ManyToOne annotation to specify a many-to-one mapping for field manager.