1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Fixes DDC-1596. Added table alias to discriminator column when using STI.

This commit is contained in:
Guilherme Blanco 2012-01-12 23:58:08 -05:00
parent da7fd2ece7
commit bb10211983

View File

@ -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);