/** * Copy each attribute from one object into the other. */ public void copyInto(Object source, Object target, boolean cloneOneToOneValueHolders) { // PERF: Avoid synchronized enumerator as is concurrency bottleneck. Vector mappings = getDescriptor().getMappings(); for (int index = 0; index < mappings.size(); index++) { DatabaseMapping mapping = (DatabaseMapping)mappings.get(index); Object value = null; if (cloneOneToOneValueHolders && mapping.isForeignReferenceMapping()){ value = ((ForeignReferenceMapping)mapping).getAttributeValueWithClonedValueHolders(source); } else { value = mapping.getAttributeValueFromObject(source); } mapping.setAttributeValueInObject(target, value); } }