if (mapping != null) {
mapping.writeFromObjectIntoRow(domainObject, databaseRow, session);
}
}
List primaryKeyClassifications = getPrimaryKeyClassifications();
Platform platform = session.getPlatform(domainObject.getClass());
// PERF: use index not enumeration
for (int index = 0; index < size; index++) {
// Ensure that the type extracted from the object is the same type as in the descriptor,
// the main reason for this is that 1-1 can optimize on vh by getting from the row as the row-type.
Class classification = (Class)primaryKeyClassifications.get(index);
Object value = databaseRow.get((DatabaseField)primaryKeyFields.get(index));
// Only check for 0 for singleton primary keys.
if ((idValidation != IdValidation.NONE) && ((value == null)
|| ((idValidation == IdValidation.ZERO) && Helper.isEquivalentToNull(value)))) {
if (shouldReturnNullIfNull) {
return null;
}
isNull = true;
}
// CR2114 following line modified; domainObject.getClass() passed as an argument
primaryKeyValues.add(platform.convertObject(value, classification));
}
}
if (isPersistenceEntity && (!isNull)) {
((PersistenceEntity)domainObject)._persistence_setPKVector(primaryKeyValues);
}