Version Mapping |
Use a Version Mapping to specify the field used for optimistic locking. If the entity is associated with multiple tables, you should use a version mapping only with the primary table. You should have only a single version mapping per persistent entity. Version mappings may be used only with the following attribute types:
int
Integer
short, Short
long, Long
Timestamp
To create a version mapping:
In the Persistence Outline View, select the field to map. The Persistence Properties View (for Attributes) displays the properties for the selected.
In the Map As field, select Version.
Use this table to complete the remaining fields on the Persistence Properties view.
Property | Description | Default |
---|---|---|
Column | The database column used for optimistic locking. | By default, the Column is assumed to be named identically to the attribute. |
Eclipse adds the following annotations to the field:
@Version
@Column(name="<COLUMN>")