mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1284: Inheritance fails in JOIN query #1616
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 21, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user thetourist:
Hi!
Sorry for my english, I'm working on that.
I've this code:
The DQL query:
{quote}
"SELECT t1 FROM Model\Entity\Placement t1 INNER JOIN t1.debtor d WITH d.name = 'test' "
{quote}
fails and show the message
{quote}
"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e2_.name' in 'on clause'"
{quote}
I hope somebody know how fix this, I can't fixing this.
@doctrinebot commented on GitHub (Jul 26, 2011):
Comment created by @beberlei:
Can you call $query->getSQL() and show me the generated SQL statement? or grab it from a log file
@doctrinebot commented on GitHub (Aug 14, 2011):
Comment created by @guilhermeblanco:
Hi,
This issue is impossible to be fixed by Doctrine side.
The inheritance requires Doctrine to make additional JOINs to also include the inherited Entities, but it's not possible at that stage to determine which JOIN-ON clause your WITH would be part of, it generates a broken SQL.
That's your situation. Since in your individual situation you're doing INNER JOINs, you are pretty much able to fix this by doing a WHERE clause. From Doctrine perspective, this issue is not fixable.
Cheers,
@doctrinebot commented on GitHub (Aug 14, 2011):
Issue was closed with resolution "Can't Fix"