if (id.isReplacementIdAttached()) {
Map<String, Object> replacement = id.getReplacementIdMap();
Iterator<Property> idProperties = descriptor.getIdProperties();
while (idProperties.hasNext()) {
AttributeProperty property = (AttributeProperty) idProperties
.next();
Object value = replacement.get(property
.getAttribute()
.getDbAttributeName());
// TODO: andrus, 11/28/2006: this operation may be redundant
// if the id wasn't generated. We may need to optimize it...
if (value != null) {
property.writePropertyDirectly(object, null, value);
}
}
ObjectId replacementId = id.createReplacementId();