Jira issue originally created by user @guilhermeblanco:
Based on code instrospection, it seems that SQL generated is wrong when you attempt to do something like this:
SELECT m FROM CompanyManager m WHERE m.InheritedSingleValuedAssociation = ?1
It seems the column that refers to the association points to wrong table (apparently it points to CompanyManager table).
If everything works, we still need to have coverage to it (we have none).
Comment created by romanb:
The first thing we need is tests to verify the issue.
Comment created by @beberlei:
I added a test to show that it works and no issue occours:
* @group [DDC-728](http://www.doctrine-project.org/jira/browse/DDC-728)
public function testQueryForInheritedSingleValuedAssociation()
$manager = new CompanyManager();
$person = new CompanyPerson();
$dql = "SELECT m FROM Doctrine\Tests\Models\Company\CompanyManager m WHERE m.spouse = ?1";
$dqlManager = $this->_em->createQuery($dql)->setParameter(1, $person->getId())->getSingleResult();
Its in Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php, see commit:
Comment created by @guilhermeblanco:
I think I fixed it sometime... it was missing a condition that is now present.
Issue was closed with resolution "Fixed"