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

Merge pull request #688 from sellingsource/master

Implement QuoteStrategy on SqlWalker walkRangeVariableDeclaration
This commit is contained in:
Guilherme Blanco 2013-06-12 12:03:24 -07:00
commit 6ef48561ba
2 changed files with 15 additions and 4 deletions

View File

@ -844,7 +844,7 @@ class SqlWalker implements TreeWalker
$this->rootAliases[] = $dqlAlias;
$sql = $class->getQuotedTableName($this->platform) . ' '
$sql = $this->quoteStrategy->getTableName($class,$this->platform) . ' '
. $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
if ($class->isInheritanceTypeJoined()) {
@ -875,7 +875,7 @@ class SqlWalker implements TreeWalker
$relation = $this->queryComponents[$joinedDqlAlias]['relation'];
$targetClass = $this->em->getClassMetadata($relation['targetEntity']);
$sourceClass = $this->em->getClassMetadata($relation['sourceEntity']);
$targetTableName = $targetClass->getQuotedTableName($this->platform);
$targetTableName = $this->quoteStrategy->getTableName($targetClass,$this->platform);
$targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName(), $joinedDqlAlias);
$sourceTableAlias = $this->getSQLTableAlias($sourceClass->getTableName(), $associationPathExpression->identificationVariable);
@ -930,7 +930,7 @@ class SqlWalker implements TreeWalker
// Join relation table
$joinTable = $assoc['joinTable'];
$joinTableAlias = $this->getSQLTableAlias($joinTable['name'], $joinedDqlAlias);
$joinTableName = $sourceClass->getQuotedJoinTableName($assoc, $this->platform);
$joinTableName = $this->quoteStrategy->getJoinTableName($assoc, $sourceClass, $this->platform);
$conditions = array();
$relationColumns = ($relation['isOwningSide'])

View File

@ -1846,6 +1846,17 @@ class SelectSqlGenerationTest extends \Doctrine\Tests\OrmTestCase
);
}
/**
* @group DDC-1845
*/
public function testQuotedTableDeclaration()
{
$this->assertSqlGeneration(
'SELECT u FROM Doctrine\Tests\Models\Quote\User u',
'SELECT q0_."user-id" AS userid0, q0_."user-name" AS username1 FROM "quote-user" q0_'
);
}
/**
* @group DDC-1845
*/