@Version is the implementation of the Optimistic Locking Design
Pattern.
It's an alternative to the traditional DB locking.
Whenever your entity is updated, the version column is incremented.
When a transaction begins the commit process, the entity manager looks to see if the version it has in memory match the version in database.
If it doesn't, it means that another
thread did an update on this row.
In this case, the entity manager throws an exception and the transaction is rolled back.