/** * INTERNAL: * Initialize the state of mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); initializeReferenceDescriptor(session); initializeSelectionQuery(session); getIndirectionPolicy().initialize(); }
/** * INTERNAL: * Initialize the reference descriptor. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getReferenceClass() == null) { throw DescriptorException.referenceClassNotSpecified(this); } setReferenceDescriptor(session.getDescriptor(getReferenceClass())); ClassDescriptor refDescriptor = this.getReferenceDescriptor(); if (refDescriptor == null) { session.getIntegrityChecker().handleError(DescriptorException.descriptorIsMissing(getReferenceClass().getName(), this)); } if (refDescriptor.isAggregateDescriptor()) { refDescriptor.checkInheritanceTreeAggregateSettings(session, this); } else { session.getIntegrityChecker().handleError(DescriptorException.referenceDescriptorIsNotAggregate(getReferenceClass().getName(), this)); } }
DatabaseMapping mapping = (DatabaseMapping)mappingsEnum.nextElement(); validateMappingType(mapping); mapping.initialize(session); if (mapping.isAggregateObjectMapping() || ((mapping.isForeignReferenceMapping() && (!mapping.isDirectCollectionMapping())) && (!((ForeignReferenceMapping)mapping).usesIndirection()))) { getLockableMappings().add(mapping);
/** * INTERNAL: * The mapping is initialized with the given session. * This mapping is fully initialized after this. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); // Initialize isMutable if not specified, default is false (assumes atomic). if (this.isMutable == null) { if (getConverter() != null) { setIsMutable(getConverter().isMutable()); } else { setIsMutable(false); } } if (getField() == null) { session.getIntegrityChecker().handleError(DescriptorException.fieldNameNotSetInMapping(this)); } getDescriptor().buildField(getField()); setFields(collectFields()); if (getConverter() != null) { getConverter().initialize(this, session); } }