if (!(fieldMapPrime instanceof ExcludeFieldMap)) {
MappingUtils.applyGlobalCopyByReference(globalConfiguration, fieldMapPrime, classMapPrime);
}
} else { // if it is a one-way field map make the other field map excluded
// make a prime field map
fieldMapPrime = new ExcludeFieldMap(classMapPrime);
MappingUtils.reverseFields(fieldMap, fieldMapPrime);
}
classMapPrime.addFieldMapping(fieldMapPrime);
}
} else {
// since it is one-way...we still need to validate if it has some type of method mapping and validate the
// field maps
for (FieldMap oneWayFieldMap : fms.toArray(new FieldMap[]{})) {
oneWayFieldMap.validate();
MappingUtils.applyGlobalCopyByReference(globalConfiguration, oneWayFieldMap, classMap);
// check to see if we need to exclude the map
if (MappingDirection.ONE_WAY.equals(oneWayFieldMap.getType())) {
fieldMapPrime = new ExcludeFieldMap(classMapPrime);
MappingUtils.reverseFields(oneWayFieldMap, fieldMapPrime);
classMapPrime.addFieldMapping(fieldMapPrime);
}
}
}