Annotation Interface Version


@Target(FIELD) @Retention(RUNTIME) public @interface Version
Indicates a version property that is used for optimistic locking.

The annotated field must be a member of an Entity annotated class.

 @Entity
 public class Employee {
     ...

     @Version
     @Column(name = "VERSION_NO")
     int versionNo;
 }