protected void initializeReferenceDescriptorAndField(AbstractSession session){ if (this.referenceClass != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (this.field == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(this.field)); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } } /**
protected void initializeReferenceDescriptorAndField(AbstractSession session){ if (this.referenceClass != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (this.field == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(this.field)); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } } /**
/** * INTERNAL: * The mapping is initialized with the given session. This mapping is fully initialized * after this. */ public void initialize(AbstractSession session) throws DescriptorException { //modified so that reference class on composite mappings is no longer mandatory if ((getReferenceClass() == null) && (getReferenceClassName() != null)) { setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName())); } if (getReferenceClass() != null) { super.initialize(session); } else { //below should be the same as AbstractCompositeObjectMapping.initialize if (getField() == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); // initialize the converter - if necessary if (hasConverter()) { getConverter().initialize(this, session); } } if(null != getContainerAccessor()) { getContainerAccessor().initializeAttributes(this.referenceClass); } }