} else {
Class lockType = getRawClass();
getField().setType(lockType);
if (isValidVersionLockingType(lockType) || isValidTimestampVersionLockingType(lockType)) {
VersionLockingPolicy policy = isValidVersionLockingType(lockType) ? new VersionLockingPolicy(getField()) : new TimestampLockingPolicy(getField());
policy.storeInObject();
policy.setIsCascaded(getDescriptor().usesCascadedOptimisticLocking());
getOwningDescriptor().setOptimisticLockingPolicy(policy);
} else {
throw ValidationException.invalidTypeForVersionAttribute(getAttributeName(), lockType, getJavaClass());