按照条件更新
@param record 更新的内容
@param where 条件
@return 更新条目数
@throws SQLException SQL执行异常
975480
public int update(Entity record, Entity where) throws SQLException{
		if (CollectionUtil.isEmpty(record)) {
			return 0;
		}
		return db.update(fixEntity(record), where);
	}
610923
public int executeRefresh(DatabaseConnection databaseConnection, T data, ObjectCache objectCache)
			throws SQLException {
		@SuppressWarnings("unchecked")
		ID id = (ID) idField.extractJavaFieldValue(data);
		// we don't care about the cache here
		T result = super.execute(databaseConnection, id, null);
		if (result == null) {
			return 0;
		}
		// copy each field from the result into the passed in object
		for (FieldType fieldType : resultsFieldTypes) {
			if (fieldType != idField) {
				fieldType.assignField(connectionSource, data, fieldType.extractJavaFieldValue(result), false,
						objectCache);
			}
		}
		return 1;
	}
48196
public int addOrUpdate(Entity entity) throws SQLException {
		return null == entity.get(primaryKeyField) ? add(entity) : update(entity);
	}
923207
public void updateRecord(final ORecordInternal<?> record) {
    if (isEnabled() && record.getIdentity().getClusterId() != excludedCluster && record.getIdentity().isValid()) {
      underlying.lock(record.getIdentity());
      try {
        if (underlying.get(record.getIdentity()) != record)
          underlying.put(record);
      } finally {
        underlying.unlock(record.getIdentity());
      }
    }

    secondary.updateRecord(record);
  }
574960
public int update(String sql) {
        String msId = msUtils.update(sql);
        return sqlSession.update(msId);
    }
1231785
protected boolean appendWhereStatement(StringBuilder sb, List<ArgumentHolder> argList, WhereOperation operation)
			throws SQLException {
		if (where == null) {
			return operation == WhereOperation.FIRST;
		}
		operation.appendBefore(sb);
		where.appendSql((addTableName ? getTableName() : null), sb, argList);
		operation.appendAfter(sb);
		return false;
	}
408642
public void addNew() throws DBException
    {
        this.getRecord().setEditMode(Constants.EDIT_NONE);
        m_objectID = null;
        m_dataSource = null;
        try   {
            this.doAddNew();
            m_iRecordStatus = DBConstants.RECORD_NEW;
        } catch (DBException ex)   {
            throw ex;
        }
        this.getRecord().setEditMode(Constants.EDIT_ADD);   // I do this before the handleNewRecord behaviors do anything
        this.getRecord().handleNewRecord();   // Display Fields
    }
309029
public int executeUpdate(String query) throws Exception {
        int returnVal = 0;
        Statement queryStatement = null;

        try (Connection sqlConnection = getConnection()) {
            queryStatement = sqlConnection.createStatement();
            returnVal = queryStatement.executeUpdate(query);
        } catch (Exception e) {
        } finally {
            try {
                if (queryStatement != null) {
                    queryStatement.close();
                }
            } catch (Exception e) {
            }
        }

        return returnVal;
    }
36941
public int updateId(ID newId) throws SQLException {
		checkForDao();
		@SuppressWarnings("unchecked")
		T t = (T) this;
		return dao.updateId(t, newId);
	}
332689
@Override
    public void update(IEntityLock lock, Date newExpiration, Integer newLockType)
            throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            if (newLockType != null) {
                primDeleteExpired(new Date(), lock.getEntityType(), lock.getEntityKey(), conn);
            }
            primUpdate(lock, newExpiration, newLockType, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem updating " + lock, sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
1362538
public int update(DatabaseConnection databaseConnection, PreparedUpdate<T> preparedUpdate) throws SQLException {
		CompiledStatement compiledStatement = preparedUpdate.compile(databaseConnection, StatementType.UPDATE);
		try {
			int result = compiledStatement.runUpdate();
			if (dao != null && !localIsInBatchMode.get()) {
				dao.notifyChanges();
			}
			return result;
		} finally {
			IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
		}
	}
331144
public function queriedUpdate($record, Query $query)
    {
        $identifier = $this->getIdentifier();

        if (isset($record[$identifier])) {
            throw new DataStoreException('Primary key is not allowed in record for queried update');
        }

        $forUpdateRecords = $this->query($query);
        $updatedIds = [];

        foreach ($forUpdateRecords as $forUpdateRecord) {
            try {
                $updatedRecord = $this->update(array_merge($record, [$identifier => $forUpdateRecord[$identifier]]));
                $updatedIds[] = $updatedRecord[$identifier];
            } catch (\Throwable $e) {
                // TODO: log failed queried updated record
                continue;
            }
        }

        return $updatedIds;
    }
1301786
public function queriedUpdate($record, Query $query)
    {
        if ($query->getLimit()
            || $query->getSort()
            || ($query instanceof RqlQuery && $query->getGroupBy())
            || $query->getSelect()) {
            throw new InvalidArgumentException('Only where clause allowed for update');
        }

        $selectResult = $this->selectForUpdateWithQuery($query);

        if (!$selectResult) {
            return [];
        }

        $conditionBuilder = new SqlConditionBuilder(
            $this->getDbTable()->getAdapter(),
            $this->getDbTable()->getTable()
        );

        $sql = new Sql($this->getDbTable()->getAdapter());
        $update = $sql->update($this->getDbTable()->getTable());
        $update->where($conditionBuilder->__invoke($query->getQuery()));
        $update->set($record);
        $sqlString = $sql->buildSqlString($update);

        $adapter = $this->dbTable->getAdapter();

        try {
            $statement = $adapter->getDriver()->createStatement($sqlString);
            $updateResult = $statement->execute();
            $updatedIds = [];

            if ($selectResult->getAffectedRows() === $updateResult->getAffectedRows()) {
                foreach ($selectResult as $record) {
                    $updatedIds[] = $record[$this->getIdentifier()];
                }
            } else {
                $effectedRecords = $this->query($query);

                foreach ($selectResult as $record) {
                    if ($record !== $effectedRecords[$this->getIdentifier()]) {
                        $updatedIds[] = $effectedRecords[$this->getIdentifier()];
                    }
                }
            }
        } catch (\Throwable $e) {
            throw new DataStoreException("Can't update records using query", 0, $e);
        }

        return $updatedIds;
    }
903473
public void doSQL(final String sql) throws SQLException {

		LOG.info("Connecting to: " + this.dbString + " with " + this.usr
				+ " and " + this.pwd);
		LOG.info("Running: " + sql);
		Connection connection = null;
		Statement st = null;

		try {
			connection = DriverManager.getConnection(this.dbString, this.usr,
					this.pwd);

			st = connection.createStatement();
			st.executeUpdate(sql);

		} finally {

			if (st != null) {
				st.close();
			}
			if (connection != null) {
				connection.close();
			}
		}

	}
642588
public void doAdd(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = m_tableRemote.add(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
1173087
private void setWhere(Where where) throws SqlParseException {
        if (where != null) {
            QueryBuilder whereQuery = QueryMaker.explan(where,this.select.isQuery);
            request.setQuery(whereQuery);
        }
    }
369568
public void update(Object po) throws Exception {
		SqlParamsPairs sqlAndParams = ModelSqlUtils.getUpdateFromObject(po);
		
		getProxy().update(sqlAndParams.getSql(), sqlAndParams.getParams());
	}