} else {
MetadataClass lockType = getRawClass();
getField().setType(getJavaClass(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());