VirtualAttributeMethodInfo info = new VirtualAttributeMethodInfo(mapping.getGetMethodName(), mapping.getSetMethodName());
classDetails.getVirtualAccessMethods().add(info);
}
}
// Initial look for the type of this attribute.
MetadataClass typeClass = getAttributeTypeFromClass(metadataClass, attribute, mapping, false);
if (typeClass == null) {
attributeDetails.setAttributeOnSuperClass(true);
unMappedAttributes.add(mapping);
}
// Set the getter and setter method names if the mapping uses property access.
if (mapping.getGetMethodName() != null) {
gettersMap.put(mapping.getGetMethodName(), attributeDetails);
attributeDetails.setGetterMethodName(mapping.getGetMethodName());
if (mapping.getSetMethodName() != null) {
settersMap.put(mapping.getSetMethodName(), attributeDetails);
attributeDetails.setSetterMethodName(mapping.getSetMethodName());
}
if (mapping.isForeignReferenceMapping() && ((ForeignReferenceMapping) mapping).requiresTransientWeavedFields()) {
attributeDetails.setWeaveTransientFieldValueHolders();
}
// If the property has a matching field, then weave it instead (unless internal weaving is disabled).
if (this.weaveInternal) {
attributeDetails.setHasField(hasFieldInClass(metadataClass, attribute));
}
} else {
attributeDetails.setHasField(true);
}
// If the attribute has a field, then the weaver needs to know in which class it was defined.
if (attributeDetails.hasField()) {
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);