DDC-715: Class table inheritance: superclass properties are not available when querying subclass #882

Closed
opened 2026-01-22 12:53:46 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 22, 2010).

Jira issue originally created by user jankramer:

Situation:

Class AnonymousUser(id, accountStatus, ...)
Class RegularUser extends AnonymousUser(username, password, email, ...)

Both are mapped entities, using class table inheritance mapping. Now the problem arises in my login adapter. As soon as I execute a query on RegularUser and try to match for a certain username, password and the inherited property accountStatus, this fails because the latter does not exist in the table RegularUser. However, I'd expect Doctrine to handle this internally because frozenStatus is in fact also a property of RegularUser. Or is this behaviour desirable?

To be clear: the following DQL fails because 'column u0_.accountStatus' is an unknown column:
SELECT u FROM User u WHERE (u.username = :identity OR u.email = :identity) AND u.accountStatus != 'frozen'

Originally created by @doctrinebot on GitHub (Jul 22, 2010). Jira issue originally created by user jankramer: Situation: Class AnonymousUser(id, accountStatus, ...) Class RegularUser extends AnonymousUser(username, password, email, ...) Both are mapped entities, using class table inheritance mapping. Now the problem arises in my login adapter. As soon as I execute a query on RegularUser and try to match for a certain username, password and the inherited property accountStatus, this fails because the latter does not exist in the table RegularUser. However, I'd expect Doctrine to handle this internally because frozenStatus is in fact also a property of RegularUser. Or is this behaviour desirable? To be clear: the following DQL fails because 'column u0_.accountStatus' is an unknown column: SELECT u FROM User u WHERE (u.username = :identity OR u.email = :identity) AND u.accountStatus != 'frozen'
admin added the Bug label 2026-01-22 12:53:46 +01:00
admin closed this issue 2026-01-22 12:53:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 26, 2010):

Comment created by @guilhermeblanco:

Is this issue still valid with our current trunk? It doesn't seem to be.

@doctrinebot commented on GitHub (Jul 26, 2010): Comment created by @guilhermeblanco: Is this issue still valid with our current trunk? It doesn't seem to be.
Author
Owner

@doctrinebot commented on GitHub (Jul 26, 2010):

Comment created by jankramer:

You're right, the latest version from the repository does indeed work as expected. I'm sorry for the inconvenience.

@doctrinebot commented on GitHub (Jul 26, 2010): Comment created by jankramer: You're right, the latest version from the repository does indeed work as expected. I'm sorry for the inconvenience.
Author
Owner

@doctrinebot commented on GitHub (Jul 26, 2010):

Issue was closed with resolution "Invalid"

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

No dependencies set.

Reference: doctrine/archived-orm#882