if (mapping.isDirectToFieldMapping()) {
// Regardless if we have an attribute override or not we
// add field name translations for every mapping to ensure
// we have the correct table name set for each field.
AbstractDirectMapping directMapping = (AbstractDirectMapping) mapping;
DatabaseField overrideField;
if (attributeOverrides.containsKey(overrideName)) {
// We have an explicit attribute override we must apply.
overrideField = attributeOverrides.get(overrideName).getOverrideField();
} else {
// If the nested aggregate object mapping defined an
// attribute override use the override field it set (and
// qualify it with our collection table. Otherwise, default
// a field name translation using the name of the field on
// the mapping.
overrideField = directMapping.getField().clone();
if (nestedAggregateObjectMapping != null && nestedAggregateObjectMapping.getAggregateToSourceFields().containsKey(overrideField.getName())) {
overrideField = nestedAggregateObjectMapping.getAggregateToSourceFields().get(overrideField.getName());
}
}