Create version mappings

Use a Version Mapping to specify the database field used by a persistent entity for optimistic locking.

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

  2. In the JPA Structure view, select the version field of the Employee entity. The JPA Details view (for attributes) displays the properties for the field.

  3. In the Map As field, select Version.

    Version Mapping for version

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

Dali automatically selects the Version column in the EMPLOYEE database table. In the JPA Structure, the Version field is identified as a version mapping, as shown in the following figure:

JPA Structure for Employee Entity

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

Congratulations! All of the entities have been successfully mapped.