[DDC-1254] EntityGenerator does not respect Class Inheritance properly Created: 06/Jul/11  Updated: 14/Jul/11  Resolved: 12/Jul/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: Git Master
Fix Version/s: 2.1.1
Security Level: All

Type: Bug Priority: Critical
Reporter: Daniel Reiche Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Symfony2 RC4, PHP 5.3., Fedora 15

Issue Links:
is required for DDC-1243 Problem to generate code for subclass... Resolved


as mentioned here DDC-904, https://github.com/symfony/symfony/issues/1550# and https://github.com/stof/StofDoctrineExtensionsBundle/issues/47
The Doctrine2 EntityGenerator does not respect inheritance of Models correctly, especially when inheriting the primary field from an abstract base class as done by Symfony2's StofDoctrineExtensionsBundle.

This is extremly annoying since it renders the generator unusable when aforementioned bundle is active. It always fails with this message:


No identifier/primary key specified for Entity 'Stof\DoctrineExtensionsBundle\Entity\Translation'. Every Entity must have an
identifier/primary key.

DDC-904 mentioned this should be fixed, but this is not true: bug is still found in latest Symfony2 git.
The docs only refer to using a single mapping format inside a bundle, but this does not work. Stof... uses xml mappings and it does not matter if i use yml or annotiations in a different bundle - the above error is still present.

Comment by venimus [ 11/Jul/11 ]

I already reported this issue, but it was not fixed http://www.doctrine-project.org/jira/browse/DDC-1177

Comment by Benjamin Eberlei [ 12/Jul/11 ]


@venimius: You didn't say a word about EntityGenerator in your ticket, which was the critical information that helped me solve this issue.

Comment by Daniel Reiche [ 13/Jul/11 ]


Comment by venimus [ 14/Jul/11 ]

@Benajmin, sorry but wasn't sure where is the problem i thought it might be me, that is why i simply stated that it is a schema-tool problem.

Generated at Mon Jul 28 18:53:16 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.