DDC-1156: MappedSuperclass not allowed in the middle of an inheritance hierarchy #1453

Open
opened 2026-01-22 13:14:59 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (May 18, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user holtkamp:

For a Class Table Inheritance mapping configuration, an intermediate MappedSuperclass causes a 'noInheritanceOnMappedSuperClass' mapping exception to be thrown by Doctrine\ORM\Mapping\ClassMetadataFactory::loadMetadata() (line 329). However, the MappedSuperclass only contains some simple properties and no inheritance configuration such as DiscriminatorMap or DiscriminatorColumn settings. The MappedSuperclass DOES extend the upper class in the hierarchy that contains this information using annotations, maybe this way it inherits this inheritance configuration.

The documentation state that a MappedSuperclass can occur in the middle of a inheritance hierarchy.
http://www.doctrine-project.org/docs/orm/2.0/en/reference/inheritance-mapping.html#mapped-superclasses

PS: this mapping seemed to be working fine for me using Doctrine 2.0.4 and Doctrine 2.0.5, further inspection showed that this is not the case. Persistence of an Entity fails, Doctrine wants to update a sequence of the persisted Entity, that does not exist as it is a Class Table Inheritance
PPS: this applies for the 2.1.0-BETA1 release, which is not yet available to create an issue for.

Originally created by @doctrinebot on GitHub (May 18, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user holtkamp: For a Class Table Inheritance mapping configuration, an intermediate MappedSuperclass causes a 'noInheritanceOnMappedSuperClass' mapping exception to be thrown by Doctrine\ORM\Mapping\ClassMetadataFactory::loadMetadata() (line 329). However, the MappedSuperclass only contains some simple properties and no inheritance configuration such as DiscriminatorMap or DiscriminatorColumn settings. The MappedSuperclass DOES extend the upper class in the hierarchy that contains this information using annotations, maybe this way it inherits this inheritance configuration. The documentation state that a MappedSuperclass can occur in the middle of a inheritance hierarchy. http://www.doctrine-project.org/docs/orm/2.0/en/reference/inheritance-mapping.html#mapped-superclasses PS: this mapping seemed to be working fine for me using Doctrine 2.0.4 and Doctrine 2.0.5, further inspection showed that this is not the case. Persistence of an Entity fails, Doctrine wants to update a sequence of the persisted Entity, that does not exist as it is a Class Table Inheritance PPS: this applies for the 2.1.0-BETA1 release, which is not yet available to create an issue for.
admin added the Bug label 2026-01-22 13:14:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1453