1
0
mirror of synced 2025-01-18 06:21:40 +03:00

Fix regression introduced with DDC-1203,DDC-1204 patch

This commit is contained in:
Benjamin Eberlei 2011-06-16 23:00:59 +02:00
parent 713f4654fd
commit 0cd0ae49a1
2 changed files with 32 additions and 1 deletions

View File

@ -281,7 +281,7 @@ class ClassMetadataFactory implements ClassMetadataFactoryInterface
throw MappingException::reflectionFailure($className, $e);
}
if ($parent) {
if ($parent && ! $parent->isMappedSuperclass) {
if ($parent->isIdGeneratorSequence()) {
$class->setSequenceGeneratorDefinition($parent->sequenceGeneratorDefinition);
} else if ($parent->isIdGeneratorTable()) {

View File

@ -89,6 +89,17 @@ class BasicInheritanceMappingTest extends \Doctrine\Tests\OrmTestCase
$class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\HierachyE');
}
/**
* @group DDC-1204
* @group DDC-1203
*/
public function testMappedSuperclassWithId()
{
$class = $this->_factory->getMetadataFor(__NAMESPACE__ . '\\SuperclassEntity');
$this->assertTrue(isset($class->fieldMappings['id']));
}
}
class TransientBaseClass {
@ -190,3 +201,23 @@ class HierachyE extends HierachyBEntity
/** @Column(type="string") */
public $e;
}
/**
* @Entity
*/
class SuperclassEntity extends SuperclassBase
{
}
/**
* @MappedSuperclass
*/
abstract class SuperclassBase
{
/**
* @Column(type="integer") @Id @GeneratedValue
* @var int
*/
public $id;
}