sourcekeys.hasMoreElements();) {
DatabaseField sourceKey = (DatabaseField)sourcekeys.nextElement();
// CR#2587. Try first to get the source key from the original query. If that fails try to get it from the object.
Object referenceKey = null;
if ((translationRow != null) && (translationRow.containsKey(sourceKey))) {
referenceKey = translationRow.get(sourceKey);
} else {
referenceKey = getDescriptor().getObjectBuilder().extractValueFromObjectForField(query.getObject(), sourceKey, query.getSession());
}
referenceObjectKeys.addElement(referenceKey);