Package com.datastax.driver.core.querybuilder

Examples of com.datastax.driver.core.querybuilder.Update


                    "The parameter key to column family should be passed");
        }
        ClassInformation classInformations = ClassInformations.INSTACE.getClass(bean);
        KeySpaceInformation keyInformation = classInformations.getKeySpace(keySpace);

        Update update = QueryBuilder.update(keyInformation.getKeySpace(),
                        keyInformation.getColumnFamily());

        FieldInformation keyField = classInformations.getKeyInformation();
        if (classInformations.isComplexKey()) {
            runComplexKey(update, key, keyField.getSubFields().getFields());
        } else {
            update.where(QueryBuilder.eq(keyField.getName(), key));
        }
        return update;
    }
View Full Code Here


    }

    @Override
    public <T> UpdateBuilder<T> updateBuilder(Class<T> classBean, Object key) {
        ClassInformation classInformation = ClassInformations.INSTACE.getClass(classBean);
        Update update = command.runUpdate(key, classBean);
        return new UpdateBuilderImpl<>(session, classInformation, keySpace,
                update);
    }
View Full Code Here

  }

  protected <T> T doUpdate(T entity, WriteOptions options) {

    Assert.notNull(entity);
    Update update = createUpdateQuery(getTableName(entity.getClass()).toCql(), entity, options, cassandraConverter);
    execute(update);
    return entity;
  }
View Full Code Here

  protected <T> Cancellable doUpdateAsync(final T entity, final WriteListener<T> listener, WriteOptions options) {

    Assert.notNull(entity);

    Update update = createUpdateQuery(getTableName(entity.getClass()).toCql(), entity, options, cassandraConverter);

    AsynchronousQueryListener aql = listener == null ? null : new AsynchronousQueryListener() {

      @SuppressWarnings("unchecked")
      @Override
View Full Code Here

   * @return The Query object to run with session.execute();
   */
  public static Update createUpdateQuery(String tableName, Object objectToSave, WriteOptions options,
      EntityWriter<Object, Object> entityWriter) {

    Update update = QueryBuilder.update(tableName);
    entityWriter.write(objectToSave, update);
    CqlTemplate.addWriteOptions(update, options);
    return update;
  }
View Full Code Here

        log.trace("Generate prepared statement for UPDATE properties {}", pms);

        PropertyMeta idMeta = entityMeta.getIdMeta();
        final EntityMetaConfig metaConfig = entityMeta.config();
        Update update = update(metaConfig.getKeyspaceName(), metaConfig.getTableName());
        final Update.Conditions updateConditions = update.onlyIf();
        if (options.hasCASConditions()) {
            for (CASCondition CASCondition : options.getCASConditions()) {
                updateConditions.and(CASCondition.toClauseForPreparedStatement());
            }
        }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.querybuilder.Update

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.