Merge and modify juokazs Sqlsrv changes
This commit is contained in:
commit
e142bd1f30
@ -844,8 +844,8 @@ class BasicEntityPersister
|
||||
}
|
||||
|
||||
return 'SELECT ' . $this->_getSelectColumnListSQL()
|
||||
. ' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' '
|
||||
. $this->_getSQLTableAlias($this->_class->name)
|
||||
. $this->_platform->appendLockHint(' FROM ' . $this->_class->getQuotedTableName($this->_platform) . ' '
|
||||
. $this->_getSQLTableAlias($this->_class->name), $lockMode)
|
||||
. $joinSql
|
||||
. ($conditionSql ? ' WHERE ' . $conditionSql : '')
|
||||
. $orderBySql
|
||||
@ -1082,7 +1082,7 @@ class BasicEntityPersister
|
||||
}
|
||||
|
||||
$sql = 'SELECT 1 '
|
||||
. $this->getLockTablesSql()
|
||||
. $this->_platform->appendLockHint($this->getLockTablesSql(), $lockMode)
|
||||
. ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' ' . $lockSql;
|
||||
$params = array_values($criteria);
|
||||
$this->_conn->executeQuery($sql, $params);
|
||||
|
@ -41,8 +41,9 @@ class LengthFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'LENGTH(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getLengthExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,9 @@ class LowerFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'LOWER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getLowerExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,12 +42,10 @@ class ModFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'MOD('
|
||||
. $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression)
|
||||
. ', '
|
||||
. $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
|
||||
. ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getModExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression),
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,9 @@ class UpperFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'UPPER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,6 +185,8 @@ class SchemaTool
|
||||
$idMapping = $class->fieldMappings[$class->identifier[0]];
|
||||
$this->_gatherColumn($class, $idMapping, $table);
|
||||
$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;
|
||||
// TODO: REMOVE
|
||||
|
@ -66,7 +66,6 @@ class DDC809Variant
|
||||
/**
|
||||
* @Column(name="variant_id", type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $variantId;
|
||||
|
||||
@ -98,7 +97,6 @@ class DDC809SpecificationValue
|
||||
/**
|
||||
* @Column(name="specification_value_id", type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $specificationValueId;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user