public function update($entity)
    {
        if ($this->idProperty === null) {
            throw new ConfigurationException('No idProperty set');
        }

        $id = $this->idProperty->getValue($entity);

        if ($id === null) {
            throw new ConfigurationException('Value of ' . $this->idProperty->getName() . ' is null');
        }

        $values = $this->getInsertValues($entity, $this->namingContention);
        $keyString = implode(array_keys($values), ' = ?,') . ' = ?';
        $idColumn = $this->namingContention->propertyToColumnName($this->idProperty);
        $onlyValues = array_values($values);
        $onlyValues[] = $id;

        $sql = "UPDATE $this->tableName SET $keyString WHERE $idColumn = ?";
        $sth = $this->pdo->prepare($sql);
        $sth->execute($onlyValues);
        return $id;
    }