DDC-388: Private properties in @MappedSupperclass don't work #483

Closed
opened 2026-01-22 12:39:54 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 3, 2010).

Jira issue originally created by user jakajancar:

All of my entites extend an abstract class Model to inherit the 'id' property and some other functionality. It has the @MappedSuperclass annotation.

If the id property is declared private to the Model class, I'll get the following exception when using entites extending it:

[03-Mar-2010 11:36:29] exception 'ReflectionException' with message 'Property id does not exist' in library/Doctrine/ORM/Mapping/ClassMetadata.php:370
Stack trace:
#0 library/Doctrine/ORM/Mapping/ClassMetadata.php(370): ReflectionClass->getProperty('id')
#1 [internal function]: Doctrine\ORM\Mapping\ClassMetadata->**wakeup()
...

I haven't looked at Doctrine code, but perhaps you should be looking for the property on the class which actually has the @Column annotation?

Originally created by @doctrinebot on GitHub (Mar 3, 2010). Jira issue originally created by user jakajancar: All of my entites extend an abstract class Model to inherit the 'id' property and some other functionality. It has the @MappedSuperclass annotation. If the id property is declared private to the Model class, I'll get the following exception when using entites extending it: ``` [03-Mar-2010 11:36:29] exception 'ReflectionException' with message 'Property id does not exist' in library/Doctrine/ORM/Mapping/ClassMetadata.php:370 Stack trace: #0 library/Doctrine/ORM/Mapping/ClassMetadata.php(370): ReflectionClass->getProperty('id') #1 [internal function]: Doctrine\ORM\Mapping\ClassMetadata->**wakeup() ... ``` I haven't looked at Doctrine code, but perhaps you should be looking for the property on the class which actually has the @Column annotation?
admin added the Bug label 2026-01-22 12:39:54 +01:00
admin closed this issue 2026-01-22 12:39:55 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 3, 2010):

@doctrinebot commented on GitHub (Mar 3, 2010): - is duplicated by [DDC-456: Wrong implementation of loading metadata from cache](http://www.doctrine-project.org/jira/browse/DDC-456)
Author
Owner

@doctrinebot commented on GitHub (Mar 3, 2010):

Comment created by romanb:

Yes, I think the 'inherited' key is simply not set for fields that are inherited from mapped superclasses. This needs to be fixed.

@doctrinebot commented on GitHub (Mar 3, 2010): Comment created by romanb: Yes, I think the 'inherited' key is simply not set for fields that are inherited from mapped superclasses. This needs to be fixed.
Author
Owner

@doctrinebot commented on GitHub (Apr 14, 2010):

Comment created by romanb:

Fixed in http://github.com/doctrine/doctrine2/commit/d4232d906e433b1fe4dd8aa85aa7a4aca3a2cf4c .
Make sure to clear the metadata cache if necessary.

@doctrinebot commented on GitHub (Apr 14, 2010): Comment created by romanb: Fixed in http://github.com/doctrine/doctrine2/commit/d4232d906e433b1fe4dd8aa85aa7a4aca3a2cf4c . Make sure to clear the metadata cache if necessary.
Author
Owner

@doctrinebot commented on GitHub (Apr 14, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Apr 14, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#483