mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3122: Querying entities with ResolveTargetEntity #3875
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 (May 14, 2014).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user heo:
Hello
The problem refers to a following situation:
You have 2 classes that use a quite simple inheritance and an interface:
When we configure the
ResolveTargetEntityListenerthe following way:when using the entity manager to find an entity:
we'll get a following
Doctrine\DBAL\DBALException:{quote}An exception occurred while executing 'SELECT t1.id AS id2 FROM bclass_table_name t1 WHERE t0.id = ?' with params [1]:{quote}
{quote}SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.id' in 'where clause'{quote}
As you can see the column names are generated properly but the WHERE clause has an invalid refference to t0 table (should be t1).
Similar problem:
http://stackoverflow.com/questions/17588682/doctrine-inheritance-replacement
@doctrinebot commented on GitHub (May 14, 2014):
Comment created by @ocramius:
Is
AClassa mapped superclass or the root of the inheritance?@doctrinebot commented on GitHub (May 15, 2014):
Comment created by heo:
AClass is the root of the inheritance. I would like to add that the only problem is the "find" method. Database relations are created properly (with the SchemaTool), all keys refer to proper columns.
@doctrinebot commented on GitHub (May 15, 2014):
Comment created by @ocramius:
[~heo] can you abstract a test case for this?