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

Merge and modify juokazs Sqlsrv changes

This commit is contained in:
Benjamin Eberlei 2010-11-18 23:14:07 +01:00
commit e142bd1f30
9 changed files with 20 additions and 19 deletions

View File

@ -844,8 +844,8 @@ class BasicEntityPersister
} }
return 'SELECT ' . $this->_getSelectColumnListSQL() return 'SELECT ' . $this->_getSelectColumnListSQL()
. ' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' ' . $this->_platform->appendLockHint(' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' '
. $this->_getSQLTableAlias($this->_class->name) . $this->_getSQLTableAlias($this->_class->name), $lockMode)
. $joinSql . $joinSql
. ($conditionSql ? ' WHERE ' . $conditionSql : '') . ($conditionSql ? ' WHERE ' . $conditionSql : '')
. $orderBySql . $orderBySql
@ -1082,7 +1082,7 @@ class BasicEntityPersister
} }
$sql = 'SELECT 1 ' $sql = 'SELECT 1 '
. $this->getLockTablesSql() . $this->_platform->appendLockHint($this->getLockTablesSql(), $lockMode)
. ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ' . $lockSql; . ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ' . $lockSql;
$params = array_values($criteria); $params = array_values($criteria);
$this->_conn->executeQuery($sql, $params); $this->_conn->executeQuery($sql, $params);

View File

@ -41,8 +41,9 @@ class LengthFunction extends FunctionNode
*/ */
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{ {
//TODO: Use platform to get SQL return $sqlWalker->getConnection()->getDatabasePlatform()->getLengthExpression(
return 'LENGTH(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
);
} }
/** /**

View File

@ -41,8 +41,9 @@ class LowerFunction extends FunctionNode
*/ */
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{ {
//TODO: Use platform to get SQL return $sqlWalker->getConnection()->getDatabasePlatform()->getLowerExpression(
return 'LOWER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
);
} }
/** /**

View File

@ -42,12 +42,10 @@ class ModFunction extends FunctionNode
*/ */
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{ {
//TODO: Use platform to get SQL return $sqlWalker->getConnection()->getDatabasePlatform()->getModExpression(
return 'MOD(' $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression),
. $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression) $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
. ', ' );
. $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
. ')';
} }
/** /**

View File

@ -41,8 +41,9 @@ class UpperFunction extends FunctionNode
*/ */
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{ {
//TODO: Use platform to get SQL return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression(
return 'UPPER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')'; $sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
);
} }
/** /**

View File

@ -185,6 +185,8 @@ class SchemaTool
$idMapping = $class->fieldMappings[$class->identifier[0]]; $idMapping = $class->fieldMappings[$class->identifier[0]];
$this->_gatherColumn($class, $idMapping, $table); $this->_gatherColumn($class, $idMapping, $table);
$columnName = $class->getQuotedColumnName($class->identifier[0], $this->_platform); $columnName = $class->getQuotedColumnName($class->identifier[0], $this->_platform);
// TODO: This seems rather hackish, can we optimize it?
$table->getColumn($class->identifier[0])->setAutoincrement(false);
$pkColumns[] = $columnName; $pkColumns[] = $columnName;
// TODO: REMOVE // TODO: REMOVE

View File

@ -43,4 +43,4 @@ class File extends AbstractContentItem
{ {
$this->extension = $ext; $this->extension = $ext;
} }
} }

View File

@ -66,7 +66,6 @@ class DDC809Variant
/** /**
* @Column(name="variant_id", type="integer") * @Column(name="variant_id", type="integer")
* @Id * @Id
* @GeneratedValue(strategy="AUTO")
*/ */
protected $variantId; protected $variantId;
@ -98,7 +97,6 @@ class DDC809SpecificationValue
/** /**
* @Column(name="specification_value_id", type="integer") * @Column(name="specification_value_id", type="integer")
* @Id * @Id
* @GeneratedValue(strategy="AUTO")
*/ */
protected $specificationValueId; protected $specificationValueId;

View File

@ -874,4 +874,4 @@ class MyAbsFunction extends \Doctrine\ORM\Query\AST\Functions\FunctionNode
$parser->match(\Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS); $parser->match(\Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS);
} }
} }