Use PersistentClass.getOptimisticLockStyle() instead of deprecated Persistent.getOptimisticLockMode()