mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1529: Multiple FROM Entities and inheritance #1918
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 (Dec 12, 2011).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user lutangar:
I got a single table inheritance on an object Content (Program, Article, etc...)
when try a simple :
{quote}
$query = $this->_em->createQuery('
SELECT a, p
FROM SG\CmsBundle\Entity\Article a, SG\ProgramBundle\Entity\Program p');
$query->getResult();
{quote}
The generated sql is :
{quote}
SELECT s0_.id AS id0, s0_.title AS title1, s0_.description AS description2, s0_.tags AS tags3, s0_.keywords AS keywords4, s0_.robots AS robots5, s0_.author_name AS author_name6, s0_.fb_description AS fb_description7, s0_.type AS type8, s0_.is_active AS is_active9, s0_.is_deleted AS is_deleted10, s0_.is_published AS is_published11, s0_.published_at AS published_at12, s0_.unpublished_at AS unpublished_at13, s0_.slug AS slug14, s0_.created_at AS created_at15, s0_.updated_at AS updated_at16, s0_.lft AS lft17, s0_.rgt AS rgt18, s0_.root AS root19, s0_.lvl AS lvl20, s1_.id AS id21, s1_.title AS title22, s1_.description AS description23, s1_.tags AS tags24, s1_.keywords AS keywords25, s1_.robots AS robots26, s1_.author_name AS author_name27, s1_.fb_description AS fb_description28, s1_.type AS type29, s1_.is_active AS is_active30, s1_.is_deleted AS is_deleted31, s1_.is_published AS is_published32, s1_.published_at AS published_at33, s1_.unpublished_at AS unpublished_at34, s1_.slug AS slug35, s1_.created_at AS created_at36, s1_.updated_at AS updated_at37, s1_.lft AS lft38, s1_.rgt AS rgt39, s1_.root AS root40, s1_.lvl AS lvl41, s0_.kind AS kind42, s0_.parent_id AS parent_id43, s0_.template_article_id AS template_article_id44, s0_.template_page_id AS template_page_id45, s0_.author_id AS author_id46, s1_.kind AS kind47, s1_.parent_id AS parent_id48, s1_.template_article_id AS template_article_id49, s1_.template_page_id AS template_page_id50, s1_.author_id AS author_id51 FROM sg_content s0_, sg_content s1_ WHERE (s0_.kind IN ('Article') AND AND s1_.kind IN ('Program'))
{quote}
The only problem is, we got an extra AND at the end of the query, the query should look smthin like this :
{quote}
SELECT ... WHERE (s0_.kind IN ('Article') AND s1_.kind IN ('Program'))
{quote}
@doctrinebot commented on GitHub (Jan 19, 2012):
Comment created by @guilhermeblanco:
Invalid for 2.2. I couldn't track the exact commit this was fixed, so I'll keep fix version for 2.3.
Coverage commit reference:
febfe35c23@doctrinebot commented on GitHub (Jan 19, 2012):
Issue was closed with resolution "Fixed"