Create Basic Mappings


Use a Basic Mapping to map an attribute directly to a database column. In the Tutorial Object Model, the firstName field of the Employee class maps directly to the F_NAME column of the EMPLOYEE database table.

  1. Select the Employee entity in the Package Explorer view.

  2. In the Persistence Outline View, select the firstName field of the Employee entity. The Persistence Properties View (for Attributes) displays the properties for the field.

  3. In the Map As field, select Basic. In the Column field, select F_NAME.

    Basic Mapping for firstName

    This figure shows the Persistence Properties page for the firstName field.

Dali adds the @Column(name="F_NAME") annotation to the entity. In the Persistence Outline, the firstName field is identified as a one-to-one mapping as shown in the following figure:

Persistence Outline for Employee Entity

This figure shows the emp_id attribute of the Employee entity in the Persistence Outline view.

Repeat this procedure to map each of the following fields as Basic mappings:

Next, you will Create One-to-One Mappings.