When using a @version field for locking purposes in one of the fields of a MappedSuperClass, things go wrong. Here is my situation:
SpecificUser extends of BaseUser
There is one mapped superclass containing things like createdOn, createdBy and finally the @version field named version.
Now, when I change a record, the following queries are created. The last one is faulty:
Query: UPDATE specificuser SET firstname = ? WHERE id = ?
Query: UPDATE baseuser SET version = version + 1 WHERE id = ? AND version = ?
Query: SELECT version FROM specificuser WHERE id = ? <======= should be: SELECT version FROM baseuser WHERE id = ?