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 JPA Structure view, select the field to map. The JPA Details view (for attributes) displays the properties for the selected.
In the Map As field, select Version.
Use this table to complete the remaining fields in the JPA Details view.
Property | Description | Default |
---|---|---|
Column | The database column mapped to the entity attribute. See "Column" for details. | By default, the Column is assumed to be named identically to the attribute and always included in the INSERT and UPDATE statements. |
Table | Name of the database table. This must be the primary table associated with the attribute's entity. | |
Temporal | Specifies the type of data. See "Temporal" for details.
|
Eclipse adds the following annotations to the field:
@Version @Column(table="<COLUMN_TABLE>", name="<COLUMN_NAME>")