Updates the associated record with custom update method
 Returns the number of affected rows.
166108
def _update_record(attribute_names = @attributes.keys)
        # check if class has custom update method
        if self.class.custom_update_method
          # run before/after callbacks defined in model
          run_callbacks(:update) do
            # timestamp
            if should_record_timestamps?
              current_time = current_time_from_proper_timezone

              timestamp_attributes_for_update_in_model.each do |column|
                column = column.to_s
                next if will_save_change_to_attribute?(column)
                write_attribute(column, current_time)
              end
            end
            # update just dirty attributes
            if partial_writes?
              # Serialized attributes should always be written in case they've been
              # changed in place.
              update_using_custom_method(changed | (attributes.keys & self.class.columns.select { |column| column.is_a?(Type::Serialized) }))
            else
              update_using_custom_method(attributes.keys)
            end
          end
        else
          super
        end
      end
301736
def update(self, rows):
        
        if len(rows) == 0:
            return

        sql, sql_args = self.get_update_sql(rows)

        # get the cursor to execute the query
        cursor = self.get_cursor()

        # execute the query
        cursor.execute(sql, sql_args)
142662
def _update_record(self, identifier, rtype=None, name=None, content=None):
        """"""
        records = self._raw_records(identifier, rtype, name, content)
        self._update_records(records, {
            'type': rtype,
            'hostname': self._relative_name(name),
            'destination': content,
            'priority': self._get_lexicon_option('priority'),
        })
        LOGGER.debug('update_record: %s', True)
        return True
145425
public void updateIfNewRow(int iRowIndex)
        throws DBException
    {
        if ((m_iCurrentLockedRowIndex != -1) && (m_iCurrentLockedRowIndex != iRowIndex))
            if (m_buffCurrentLockedData != null)
        {
            {
                FieldList fieldList = this.makeRowCurrent(m_iCurrentLockedRowIndex, false);     // Read this row if it isn't current
                if (this.isRecordChanged())
                {   // Only update if there are changes.
                    synchronized (this)
                    {   // This time do the physical read (last time I asked for the cache)
                        DBException ex = null;
                        fieldList = this.makeRowCurrent(m_iCurrentLockedRowIndex, true);        // Read this row if it isn't current
                        if ((this.isAppending())
                            && ((m_iCurrentLockedRowIndex == m_iLastRecord + 1) && (m_iLastRecord != RECORD_UNKNOWN)))
                        {
                            m_table.add(fieldList);   // New record = add
                            this.setCurrentRow(-1);     // Make sure I don't try to use this unknown record without re-reading it.
                            if (m_iLastRecord != RECORD_UNKNOWN)    // Could have been set in 'add'
                                m_iLastRecord++;
                        }
                        else
                        {
                            if ((fieldList.getEditMode() == Constants.EDIT_CURRENT) || (fieldList.getEditMode() == Constants.EDIT_IN_PROGRESS))
                            {
                                try {
                                    m_table.set(fieldList);   // Current record = set
                                } catch (DBException e) {
                                    ex = e;
                                }
                            }
                            this.setCurrentRow(-1);    // Can't use current record anymore
                        }
                        m_iCurrentLockedRowIndex = -1;
                        m_buffCurrentLockedData = null;
                        if (ex != null)
                            throw ex;
                    }
                }
            }
        }
    }
571414
protected int update(Connection connection, RecordStream recordStream)
            throws SQLException, IOException {
        int count = 0;
        PreparedStatement insertFileHash = statement(connection,
                Query.INSERT_FILEHASH);
        PreparedStatement insertMeta = statement(connection, Query.INSERT_META);
        PreparedStatement insertCVE = statement(connection, Query.INSERT_CVES);
        while (recordStream.hasNext()) {
            VictimsRecord vr = recordStream.getNext();
            String hash = vr.hash.trim();

            // remove if already present
            deleteRecord(connection, hash);

            // add the new/updated hash
            int id = insertRecord(connection, hash);

            // insert file hahes
            for (String filehash : vr.getHashes(Algorithms.SHA512).keySet()) {
                setObjects(insertFileHash, id, filehash.trim());
                insertFileHash.addBatch();
            }

            // insert metadata key-value pairs
            HashMap<String, String> md = vr.getFlattenedMetaData();
            for (String key : md.keySet()) {
                setObjects(insertMeta, id, key, md.get(key));
                insertMeta.addBatch();
            }

            // insert cves
            for (String cve : vr.cves) {
                setObjects(insertCVE, id, cve.trim());
                insertCVE.addBatch();
            }

            count++;
        }
        executeBatchAndClose(insertFileHash, insertMeta, insertCVE);
        return count;
    }
949774
def updateRecordValues(self):
        
        record = self.record()
        if not record:
            return
        
        # update the record information
        tree = self.treeWidget()
        if not isinstance(tree, XTreeWidget):
            return
        
        for column in record.schema().columns():
            c = tree.column(column.displayName())
            if c == -1:
                continue
            
            elif tree.isColumnHidden(c):
                continue
            
            else:
                val = record.recordValue(column.name())
                self.updateColumnValue(column, val, c)
        
        # update the record state information
        if not record.isRecord():
            self.addRecordState(XOrbRecordItem.State.New)
        
        elif record.isModified():
            self.addRecordState(XOrbRecordItem.State.Modified)
856923
def _update_record(self, identifier=None, rtype=None, name=None, content=None):
        """"""
        return self._change_record_sets('UPSERT', rtype, name, content)
1215014
def _update_data(self, data={}):
        ''''''

        # Store the changes to prevent this update from affecting it
        pending_changes = self._changes or {}
        try:
            del self._changes
        except:
            pass

        # Map custom fields into our custom fields object
        try:
            custom_field_data = data.pop('custom_fields')
        except KeyError:
            pass
        else:
            self.custom_fields = Custom_Fields(custom_field_data)

        # Map all other dictionary data to object attributes
        for key, value in data.iteritems():
            lookup_key = self._field_type.get(key, key)

            # if it's a datetime object, turn into proper DT object
            if lookup_key == 'datetime' or lookup_key == 'date':
                self.__dict__[key] = datetime_parse(value)
            else:
                # Check to see if there's cache data for this item.
                # Will return an object if it's recognized as one.
                self.__dict__[key] = self._redmine.check_cache(lookup_key, value)


        # Set the changes dict to track all changes from here on out
        self._changes = pending_changes
154155
public void update(Record record, boolean isText) throws MPXJException
   {
      int length = record.getLength();

      for (int i = 0; i < length; i++)
      {
         if (isText == true)
         {
            add(getTaskCode(record.getString(i)));
         }
         else
         {
            add(record.getInteger(i).intValue());
         }
      }
   }
1134094
def update(cls, **kwargs):
        '''
        
        '''
        q = cls._get_instance(**{'id': kwargs['id']})
        if q:
            for k, v in kwargs.items():
                setattr(q, k, v)
            _action_and_commit(q, session.add)
        else:
            cls.get_or_create(**kwargs)
215577
def capture_update(self, *, update_fields=()):
        """"""
        return self.capture_update_from_model(self.table_name, self.record_id,
                                              update_fields=update_fields)
1081151
private function updateRecordStatus($id, $recordStatus, $method)
    {
        $sets[ 'record_status' ] = $recordStatus;
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'updateRecordSets')) {
            $this->updateRecordSets($sets);
        }

        if (method_exists($this, $beforeMethod = 'before' . ucfirst($method))) {
            call_user_func_array([&$this, $beforeMethod], [$sets]);
        }

        if ($this->qb->table($this->table)->limit(1)->update($sets, [$primaryKey => $id])) {
            if (method_exists($this, $afterMethod = 'after' . ucfirst($method))) {
                return call_user_func([&$this, $beforeMethod]);
            }

            return true;
        }

        return false;
    }
562760
public boolean update(String tableName, Record record) {
		return update(tableName, config.dialect.getDefaultPrimaryKey(), record);
	}
484718
public int update() {
        this.beforeCheck();
        String       sql             = this.buildUpdateSQL(null, updateColumns);
        List<Object> columnValueList = new ArrayList<>();
        updateColumns.forEach((key, value) -> columnValueList.add(value));
        columnValueList.addAll(paramValues);
        return this.execute(sql, columnValueList);
    }
1024512
def update(self, *args, **kwargs):
        """"""

        self.augment_args(args, kwargs)

        kwargs['log_action'] = kwargs.get('log_action', 'update')

        if not self.rec:
            return self.add(**kwargs)
        else:
            for k, v in kwargs.items():

                # Don't update object; use whatever was set in the original record
                if k not in ('source', 's_vid', 'table', 't_vid', 'partition', 'p_vid'):
                    setattr(self.rec, k, v)

            self._session.merge(self.rec)
            if self._logger:
                self._logger.info(self.rec.log_str)
            self._session.commit()

            self._ai_rec_id = None
            return self.rec.id
873744
async def update(query):
    
    assert isinstance(query, peewee.Update),\
        ("Error, trying to run update coroutine"
         "with wrong query class %s" % str(query))

    cursor = await _execute_query_async(query)
    rowcount = cursor.rowcount

    await cursor.release()
    return rowcount
650665
private synchronized void updateRecordsWrittenMeter() {
    if (this.recordsWrittenMeter.isPresent()) {
      this.recordsWrittenMeter.get().mark(recordsWritten() - this.recordsWrittenMeter.get().getCount());
    }
  }