1
0
Fork 0
mirror of synced 2025-04-01 12:26:11 +03:00

[2.0] Fixed issue with Subselect not handling well inheritance type JOINED.

This commit is contained in:
guilhermeblanco 2010-03-15 19:04:14 +00:00
parent a53c2fbd6c
commit c7ac5650c2

View file

@ -1012,12 +1012,16 @@ class SqlWalker implements TreeWalker
$identificationVarDecls = $subselectFromClause->identificationVariableDeclarations;
$firstIdentificationVarDecl = $identificationVarDecls[0];
$rangeDecl = $firstIdentificationVarDecl->rangeVariableDeclaration;
$class = $this->_em->getClassMetadata($rangeDecl->abstractSchemaName);
$dqlAlias = $rangeDecl->aliasIdentificationVariable;
$class = $this->_em->getClassMetadata($rangeDecl->abstractSchemaName);
$sql = ' FROM ' . $class->getQuotedTableName($this->_platform) . ' '
. $this->getSqlTableAlias($class->primaryTable['name'], $dqlAlias);
if ($class->isInheritanceTypeJoined()) {
$sql .= $this->_generateClassTableInheritanceJoins($class, $dqlAlias);
}
foreach ($firstIdentificationVarDecl->joinVariableDeclarations as $joinVarDecl) {
$sql .= $this->walkJoinVariableDeclaration($joinVarDecl);
}