1
0
mirror of synced 2024-12-14 07:06:04 +03:00

small refacory on AbstractEntityInheritancePersister

This commit is contained in:
Fabio B. Silva 2012-07-22 15:31:26 -03:00
parent e6f08f0b92
commit 7e348b7815

View File

@ -60,14 +60,17 @@ abstract class AbstractEntityInheritancePersister extends BasicEntityPersister
*/
protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r')
{
$columnName = $class->columnNames[$field];
$sql = $this->getSQLTableAlias($class->name, $alias == 'r' ? '' : $alias) . '.' . $this->quoteStrategy->getColumnName($field, $class, $this->platform);
$tableAlias = $alias == 'r' ? '' : $alias;
$columnName = $class->columnNames[$field];
$columnAlias = $this->getSQLColumnAlias($columnName);
$sql = $this->getSQLTableAlias($class->name, $tableAlias) . '.'
. $this->quoteStrategy->getColumnName($field, $class, $this->platform);
$this->rsm->addFieldResult($alias, $columnAlias, $field, $class->name);
if (isset($class->fieldMappings[$field]['requireSQLConversion'])) {
$type = Type::getType($class->getTypeOfField($field));
$sql = $type->convertToPHPValueSQL($sql, $this->platform);
$type = Type::getType($class->getTypeOfField($field));
$sql = $type->convertToPHPValueSQL($sql, $this->platform);
}
return $sql . ' AS ' . $columnAlias;