// key out of it. If the primary key is stored accross a 1-1 a value
// holder needs to be built/triggered to get at it.
// In this case recursively build the shallow original accross the 1-1.
// We only need the primary key for that object, and we know
// what that primary key is: it is the foreign key in our row.
ClassDescriptor descriptor = getReferenceDescriptor();
AbstractRecord targetRow = new DatabaseRecord();
for (Iterator keys = getSourceToTargetKeyFields().keySet().iterator(); keys.hasNext();) {
DatabaseField foreignKey = (DatabaseField)keys.next();
DatabaseField targetKey = (DatabaseField)getSourceToTargetKeyFields().get(foreignKey);
targetRow.put(targetKey, databaseRow.get(foreignKey));
}
Object targetObject = descriptor.getObjectBuilder().buildNewInstance();
descriptor.getObjectBuilder().buildAttributesIntoShallowObject(targetObject, databaseRow, query);
targetObject = getIndirectionPolicy().valueFromRow(targetObject);
setAttributeValueInObject(original, targetObject);
}