mirror of
https://github.com/doctrine/orm.git
synced 2026-04-27 00:18:04 +02:00
DDC-715: Class table inheritance: superclass properties are not available when querying subclass #882
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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'
@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 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):
Issue was closed with resolution "Invalid"