Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Configuring a Basic Mapping

Use a basic mapping to map an field that contains a primitive or JDK object value. For example, use a basic mapping to store a String attribute in a VARCHAR column.

You define a basic mapping at one of the property (getter or setter method) or field level of your entity.

Optionally, you can define the strategy for fetching data from the database (see "Configuring Lazy Loading".

For more information, see "Understanding Direct-to-Field Mapping" in the Oracle TopLink Developer's Guide.

Using Annotations

Example 7-17 shows how to use the @Basic annotation to specify a basic mapping for field firstName.

Example 7-17 @Basic

@Basic()
@Column(name="F_NAME")
public String getFirstName() {
    return firstName;
}