DatabaseField field = DatabaseField.class.cast(fields.nextElement()); if (mapping.isReadOnly()) { Vector mappingVector = (Vector) getReadOnlyMappingsByField().get(field);
/** * INTERNAL: * It is responsible for initializing the policy; */ public void initialize(AbstractSession session) { DatabaseMapping mapping = mappingFromLockField(); if (mapping == null) { if (isStoredInObject()) { throw OptimisticLockException.mustHaveMappingWhenStoredInObject(descriptor.getJavaClass()); } else { return; } } if (mapping.isReadOnly()) { throw DescriptorException.mappingCanNotBeReadOnly(mapping); } else { if (isStoredInCache()) { session.getIntegrityChecker().handleError(DescriptorException.mustBeReadOnlyMappingWhenStoredInCache(mapping)); } } }