Executes Update/ Delete CQL query.

@param cqlQuery
the cql query
@return the int
164288
public int executeUpdateDeleteQuery(String cqlQuery) {
        if (log.isDebugEnabled()) {
            log.debug("Executing cql query {}.", cqlQuery);
        }
        try {
            CqlResult result = (CqlResult) executeCQLQuery(cqlQuery, true);
            return result.getNum();
        } catch (Exception e) {
            log.error("Error while executing updated query: {}, Caused by: . ", cqlQuery, e);
            return 0;
        }

    }
348556
@Override
  public long executeCount(CommandContext commandContext) {
    checkQueryOk();
    DbReadOnlyIdentityServiceProvider identityProvider = getIdentityProvider(commandContext);
    return identityProvider.findTenantCountByQueryCriteria(this);
  }
1111738
def query_delete(cls, expression=None):
        
        if expression is not None:
            executor = Executor(cls.__database__)
            result = executor.execute(expression)
        else:
            result = cls._query.all_index()

        for hash_id in result:
            cls.load(hash_id, convert_key=False).delete()
383765
public int deleteAll() throws SQLException {

		int count = 0;

		if (isTableExists()) {
			DeleteBuilder<GeometryIndex, GeometryIndexKey> db = deleteBuilder();
			PreparedDelete<GeometryIndex> deleteQuery = db.prepare();
			count = delete(deleteQuery);
		}

		return count;
	}
131536
@NonNull
  public static DeleteSelection deleteFrom(@Nullable String keyspace, @NonNull String table) {
    return deleteFrom(
        keyspace == null ? null : CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table));
  }
1109359
public String createDeleteQuery(KunderaQuery kunderaQuery) {
        EntityMetadata metadata = kunderaQuery.getEntityMetadata();
        MetamodelImpl metaModel =
            (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
        CQLTranslator translator = new CQLTranslator();
        String delete_query = translator.DELETE_QUERY;

        String tableName = kunderaQuery.getEntityMetadata().getTableName();
        delete_query = StringUtils.replace(delete_query, CQLTranslator.COLUMN_FAMILY,
            translator.ensureCase(new StringBuilder(), tableName, false).toString());

        StringBuilder builder = new StringBuilder(delete_query);
        builder.append(CQLTranslator.ADD_WHERE_CLAUSE);

        Class compoundKeyClass = metadata.getIdAttribute().getBindableJavaType();
        EmbeddableType compoundKey = null;
        String idColumn;
        if (metaModel.isEmbeddable(compoundKeyClass)) {
            compoundKey = metaModel.embeddable(compoundKeyClass);
            idColumn = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName();
        } else {
            idColumn = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName();
        }

        onCondition(metadata, metaModel, compoundKey, idColumn, builder, false, translator, false);

        return builder.toString();
    }
1006181
public void updateQuery(QueryControllerQuery query) {
		int position = getElementPosition(query.getID());
		queries.set(position, query);
	}
1220081
protected <T> int executeCountQuery(SearchCriteriaBean criteria, EntityManager entityManager, Class<T> type) {
        CriteriaBuilder builder = entityManager.getCriteriaBuilder();
        CriteriaQuery<Long> countQuery = builder.createQuery(Long.class);
        Root<T> from = countQuery.from(type);
        countQuery.select(builder.count(from));
        applySearchCriteriaToQuery(criteria, builder, countQuery, from, true);
        TypedQuery<Long> query = entityManager.createQuery(countQuery);
        return query.getSingleResult().intValue();
    }
1213521
public ResultSet execute(String keyspace, @NotNull String query) {
        getMetricsFactory().getCounter(MetricsType.CASSANDRA_QUERIES_COUNT.name()).inc();

        Timer time = getMetricsFactory().getTimer(MetricsType.CASSANDRA_EXECUTE.name());

        ResultSet resultSet = getOrCreateSession(keyspace).execute(query);
        time.stop();

        return resultSet;
    }
382180
public int deleteCascade(PreparedQuery<DataColumnConstraints> preparedDelete)
			throws SQLException {
		int count = 0;
		if (preparedDelete != null) {
			List<DataColumnConstraints> constraintsList = query(preparedDelete);
			count = deleteCascade(constraintsList);
		}
		return count;
	}
728175
@Override
    public synchronized int executeUpdate(final String query) throws DatabaseEngineException {
        Statement s = null;
        try {
            getConnection();
            s = conn.createStatement();
            return s.executeUpdate(query);
        } catch (final Exception ex) {
            throw new DatabaseEngineException("Error handling native query", ex);
        } finally {
            if (s != null) {
                try {
                    s.close();
                } catch (final Exception e) {
                    logger.trace("Error closing statement.", e);
                }
            }
        }
    }
415836
@NonNull
  public static UpdateStart update(@Nullable String keyspace, @NonNull String table) {
    return update(
        keyspace == null ? null : CqlIdentifier.fromCql(keyspace), CqlIdentifier.fromCql(table));
  }
5131
private ResultSet executeCQL(String cql) {
        m_logger.debug("Executing CQL: {}", cql);
        try {
            return m_dbservice.getSession().execute(cql);
        } catch (Exception e) {
            m_logger.error("CQL query failed", e);
            m_logger.info("   Query={}", cql);
            throw e;
        }
    }
906996
public int update(@NotNull SqlQuery query) {
        return withCurrentTransaction(query, tx -> {
            logQuery(query);

            try (PreparedStatement ps = tx.getConnection().prepareStatement(query.getSql())) {
                prepareStatementFromQuery(ps, query);

                long startTime = currentTimeMillis();
                int count = ps.executeUpdate();
                logQueryExecution(query, currentTimeMillis() - startTime);
                return count;
            }
        });
    }
1212213
@Deprecated
  public void deleteByQuery(Query query, RequestOptions requestOptions) throws AlgoliaException {
    this.deleteByQuery(query, 100000, requestOptions);
  }
1349768
@Override
    public int executeUpdate(String updateSql) throws JdbcServerException {
        log.info("Received execute update request: " + updateSql);
        Message response = handleMessageAndCheckResponse(JdbcMessage.execute(updateSql));
        return Optional.ofNullable(
                response.getHeader(JdbcMessageHeaders.JDBC_ROWS_UPDATED))
                .map(Object::toString).map(Integer::valueOf)
                .orElse(0);
    }
533343
@Override
  public CqlQuery<K, N, V> setCqlVersion(String version){
    this.cqlVersion=version;
    if (this.cqlVersion.startsWith("3")) {
    	cql3 = true;
    }
    return this;
  }