// If one has not we will default to the primary key of the reference
// class. The primary key cannot be composite at this point.
String fieldOrPropertyName = MetadataHelper.getName(m_name, referenceDescriptor.getIdAttributeName(), logger.MAP_KEY_ATTRIBUTE_NAME, logger, mappingAccessor.getAnnotatedElementName());
// Look up the referenceAccessor
MetadataAccessor referenceAccessor = referenceDescriptor.getMappingAccessor(fieldOrPropertyName);
if (referenceAccessor == null) {
// 266912: relax validation for MappedSuperclass descriptors when the map key is an unresolved generic type
if (referenceDescriptor.isMappedSuperclass()) {
return null;
} else {
throw ValidationException.couldNotFindMapKey(fieldOrPropertyName, referenceDescriptor.getJavaClass(), (DatabaseMapping)mapping);
}
}
return referenceAccessor.getAccessibleObjectName();
}
}