1
0
mirror of synced 2024-12-13 14:56:01 +03:00

[2.0][DDC-416] Fixed.

This commit is contained in:
romanb 2010-03-18 11:40:43 +00:00
parent 91ac6fae3e
commit 76663a0501
2 changed files with 11 additions and 1 deletions

View File

@ -398,7 +398,11 @@ class JoinedSubclassPersister extends StandardEntityPersister
$conditionSql = '';
foreach ($criteria as $field => $value) {
if ($conditionSql != '') $conditionSql .= ' AND ';
$conditionSql .= $baseTableAlias . '.';
if (isset($this->_class->fieldMappings[$field]['inherited'])) {
$conditionSql .= $this->_getSQLTableAlias($this->_em->getClassMetadata($this->_class->fieldMappings[$field]['inherited'])) . '.';
} else {
$conditionSql .= $baseTableAlias . '.';
}
if (isset($this->_class->columnNames[$field])) {
$conditionSql .= $this->_class->getQuotedColumnName($field, $this->_platform);
} else if ($assoc !== null) {

View File

@ -71,6 +71,12 @@ class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->_em->clear();
$guilherme = $this->_em->getRepository(get_class($employee))->findOneBy(array('name' => 'Guilherme Blanco'));
$this->assertTrue($guilherme instanceof CompanyEmployee);
$this->assertEquals('Guilherme Blanco', $guilherme->getName());
$this->_em->clear();
$query = $this->_em->createQuery("update Doctrine\Tests\Models\Company\CompanyEmployee p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
$query->setParameter(1, 'NewName');
$query->setParameter(2, 'NewDepartment');