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 JPA Structure view, select the firstName field of the Employee entity. The JPA Details 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

    JPA Details view for the firstName field.

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

JPA Structure for Employee Entity

The firstName attribute of the Employee entity in the JPA Structure view.

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

Next, you will Create one-to-one mappings.