boolean isNull = false;
// Allow for inheritance, the concrete descriptor must always be used.
if (descriptor.hasInheritance() && (domainObject.getClass() != descriptor.getJavaClass()) && (!domainObject.getClass().getSuperclass().equals(descriptor.getJavaClass()))) {
return session.getDescriptor(domainObject).getObjectBuilder().extractPrimaryKeyFromObject(domainObject, session, shouldReturnNullIfNull);
} else {
IdValidation idValidation = descriptor.getIdValidation();
List primaryKeyFields = descriptor.getPrimaryKeyFields();
Vector primaryKeyValues = new NonSynchronizedVector(primaryKeyFields.size());
List mappings = getPrimaryKeyMappings();
int size = mappings.size();