diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index f358ca756..d81c48d5b 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -284,10 +284,6 @@ class ClassMetadataFactory throw MappingException::reflectionFailure($className, $e); } - // Verify & complete identifier mapping - if ( ! $class->identifier && ! $class->isMappedSuperclass) { - throw MappingException::identifierRequired($className); - } if ($parent && ! $parent->isMappedSuperclass) { if ($parent->isIdGeneratorSequence()) { $class->setSequenceGeneratorDefinition($parent->sequenceGeneratorDefinition); @@ -315,6 +311,11 @@ class ClassMetadataFactory $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs); } + // Verify & complete identifier mapping + if ( ! $class->identifier && ! $class->isMappedSuperclass) { + throw MappingException::identifierRequired($className); + } + // verify inheritance if (!$parent && !$class->isMappedSuperclass && !$class->isInheritanceTypeNone()) { if (count($class->discriminatorMap) == 0) {