*/
public void getValueFromRecordForMapping(DatabaseRecord entityRecord,DatabaseMapping mapping, FieldResult fieldResult, DatabaseRecord databaseRecord){
ClassDescriptor currentDescriptor = mapping.getReferenceDescriptor();
/** check if this FieldResult contains any other FieldResults, process it if it doesn't */
if (fieldResult.getFieldResults()==null){
DatabaseField dbfield = processValueFromRecordForMapping(currentDescriptor,fieldResult.getMultipleFieldIdentifiers(),1);
/** If it is a 1:1 mapping we need to do the target to source field conversion. If it is an aggregate, it is fine as it is*/
if (mapping.isOneToOneMapping()){
dbfield = (DatabaseField)(((OneToOneMapping)mapping).getTargetToSourceKeyFields().get(dbfield));
}
entityRecord.put(dbfield, databaseRecord.get(fieldResult.getColumnName()));
return;
}
/** This processes each FieldResult stored in the collection of FieldResults individually */
Iterator fieldResults = fieldResult.getFieldResults().iterator();
while (fieldResults.hasNext()){
FieldResult tempFieldResult = ((FieldResult)fieldResults.next());
DatabaseField dbfield = processValueFromRecordForMapping(currentDescriptor,tempFieldResult.getMultipleFieldIdentifiers(),1);
if (mapping.isOneToOneMapping()){
dbfield = (DatabaseField)(((OneToOneMapping)mapping).getTargetToSourceKeyFields().get(dbfield));
}
entityRecord.put(dbfield, databaseRecord.get(tempFieldResult.getColumnName()));
}