1
0
mirror of synced 2025-02-21 14:43:14 +03:00

DDC-1490 - Fix id generation of sequence and identity to cast values to int

This commit is contained in:
Benjamin Eberlei 2011-11-13 15:36:48 +01:00
parent 01697fee3d
commit 5aeabcb445
2 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ class IdentityGenerator extends AbstractIdGenerator
*/
public function generate(EntityManager $em, $entity)
{
return $em->getConnection()->lastInsertId($this->_seqName);
return (int)$em->getConnection()->lastInsertId($this->_seqName);
}
/**

View File

@ -61,7 +61,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
$conn = $em->getConnection();
$sql = $conn->getDatabasePlatform()->getSequenceNextValSQL($this->_sequenceName);
$this->_nextValue = $conn->fetchColumn($sql);
$this->_nextValue = (int)$conn->fetchColumn($sql);
$this->_maxValue = $this->_nextValue + $this->_allocationSize;
}