diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php index 171264a1d..8644e1d6e 100644 --- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php @@ -48,12 +48,13 @@ class SingleTablePersister extends AbstractEntityInheritancePersister $columnList = parent::_getSelectColumnListSQL(); - // Append discriminator column - $discrColumn = $this->_class->discriminatorColumn['name']; - $columnList .= ', ' . $discrColumn; - $rootClass = $this->_em->getClassMetadata($this->_class->rootEntityName); $tableAlias = $this->_getSQLTableAlias($rootClass->name); + + // Append discriminator column + $discrColumn = $this->_class->discriminatorColumn['name']; + $columnList .= ', ' . $tableAlias . '.' . $discrColumn; + $resultColumnName = $this->_platform->getSQLResultCasing($discrColumn); $this->_rsm->setDiscriminatorColumn('r', $resultColumnName);