DDC-1254: EntityGenerator does not respect Class Inheritance properly #1580

Closed
opened 2026-01-22 13:18:49 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 6, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user bigbadbassman:

Hi,
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:

[Doctrine\ORM\Mapping\MappingException]

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.

Originally created by @doctrinebot on GitHub (Jul 6, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user bigbadbassman: Hi, as mentioned here [DDC-904](http://www.doctrine-project.org/jira/browse/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: [Doctrine\ORM\Mapping\MappingException] No identifier/primary key specified for Entity 'Stof\DoctrineExtensionsBundle\Entity\Translation'. Every Entity must have an identifier/primary key. [DDC-904](http://www.doctrine-project.org/jira/browse/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.
admin added the Bug label 2026-01-22 13:18:49 +01:00
admin closed this issue 2026-01-22 13:18:49 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 6, 2011):

@doctrinebot commented on GitHub (Jul 6, 2011): - is required for [DDC-1243: Problem to generate code for subclasses without identifiers.](http://www.doctrine-project.org/jira/browse/DDC-1243)
Author
Owner

@doctrinebot commented on GitHub (Jul 11, 2011):

Comment created by venimus:

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

@doctrinebot commented on GitHub (Jul 11, 2011): Comment created by venimus: I already reported this issue, but it was not fixed http://www.doctrine-project.org/jira/browse/[DDC-1177](http://www.doctrine-project.org/jira/browse/DDC-1177)
Author
Owner

@doctrinebot commented on GitHub (Jul 12, 2011):

Comment created by @beberlei:

Fixed

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

@doctrinebot commented on GitHub (Jul 12, 2011): Comment created by @beberlei: Fixed @venimius: You didn't say a word about EntityGenerator in your ticket, which was the critical information that helped me solve this issue.
Author
Owner

@doctrinebot commented on GitHub (Jul 12, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 12, 2011): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Jul 13, 2011):

Comment created by bigbadbassman:

THANKS!

@doctrinebot commented on GitHub (Jul 13, 2011): Comment created by bigbadbassman: THANKS!
Author
Owner

@doctrinebot commented on GitHub (Jul 14, 2011):

Comment created by venimus:

@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.

@doctrinebot commented on GitHub (Jul 14, 2011): Comment created by venimus: @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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1580