MetadataClass lockType = getRawClass();
getDatabaseField().setTypeName(getJavaClassName(lockType));
if (isValidVersionLockingType(lockType) || isValidTimestampVersionLockingType(lockType)) {
for (MetadataDescriptor owningDescriptor : getOwningDescriptors()) {
VersionLockingPolicy policy = isValidVersionLockingType(lockType) ? new VersionLockingPolicy(getDatabaseField()) : new TimestampLockingPolicy(getDatabaseField());
policy.storeInObject();
policy.setIsCascaded(getDescriptor().usesCascadedOptimisticLocking());
owningDescriptor.setOptimisticLockingPolicy(policy);
}
} else {