attributeDetails.setDeclaringType(Type.getType(getAttributeDeclaringClass(metadataClass, attribute).getTypeName()));
}
// Check for lazy/value-holder indirection.
if (mapping.isForeignReferenceMapping()) {
ForeignReferenceMapping foreignReferenceMapping = (ForeignReferenceMapping)mapping;
// repopulate the reference class with the target of this mapping
attributeDetails.setReferenceClassName(foreignReferenceMapping.getReferenceClassName());
if (attributeDetails.getReferenceClassName() != null) {
MetadataClass referenceClass = metadataClass.getMetadataFactory().getMetadataClass(attributeDetails.getReferenceClassName());
attributeDetails.setReferenceClassType(Type.getType(referenceClass.getTypeName()));
}
// This time, look up the type class and include the superclass so we can check for lazy.
if (typeClass == null){
typeClass = getAttributeTypeFromClass(metadataClass, attribute, foreignReferenceMapping, true);
}
if (weaveValueHolders && (foreignReferenceMapping.getIndirectionPolicy() instanceof BasicIndirectionPolicy) &&
(typeClass != null) && (!typeClass.extendsInterface(ValueHolderInterface.class))) {
if (mapping.isObjectReferenceMapping() && attributeDetails.isVirtualProperty()){
classDetails.setShouldWeaveValueHolders(false);
log(SessionLog.WARNING, CANNOT_WEAVE_VIRTUAL_ONE_TO_ONE, new Object[]{classDetails.getClassName(), attributeDetails.getAttributeName()});
} else {