Package com.datastax.driver.core.querybuilder

Examples of com.datastax.driver.core.querybuilder.Delete.where()


            case DEL:
                {
                    Delete delete = table == null
                                  ? delete().all().from(mapper.getKeyspace(), mapper.getTable())
                                  : delete().all().from(table);
                    Delete.Where where = delete.where();
                    for (int i = 0; i < mapper.primaryKeySize(); i++)
                        where.and(eq(mapper.getPrimaryKeyColumn(i).getColumnName(), bindMarker()));
                    return delete.toString();
                }
            case SLICE:
View Full Code Here


        .all()
        .from(tableName.getKeyspace(), tableName.getTable());

    for (Map.Entry<String, Object> component
        : getEntityIdColumnValues(layout, entityId).entrySet()) {
      delete.where(eq(component.getKey(), component.getValue()));
    }

    if (column != null) {
      delete.where(eq(FAMILY_COL, column.getFamilyBuffer()));
      if (column.containsQualifier()) {
View Full Code Here

        : getEntityIdColumnValues(layout, entityId).entrySet()) {
      delete.where(eq(component.getKey(), component.getValue()));
    }

    if (column != null) {
      delete.where(eq(FAMILY_COL, column.getFamilyBuffer()));
      if (column.containsQualifier()) {
        delete.where(eq(QUALIFIER_COL, column.getQualifierBuffer()));
        if (version != null) {
          delete.where(eq(VERSION_COL, version));
        }
View Full Code Here

    }

    if (column != null) {
      delete.where(eq(FAMILY_COL, column.getFamilyBuffer()));
      if (column.containsQualifier()) {
        delete.where(eq(QUALIFIER_COL, column.getQualifierBuffer()));
        if (version != null) {
          delete.where(eq(VERSION_COL, version));
        }
      }
    }
View Full Code Here

    if (column != null) {
      delete.where(eq(FAMILY_COL, column.getFamilyBuffer()));
      if (column.containsQualifier()) {
        delete.where(eq(QUALIFIER_COL, column.getQualifierBuffer()));
        if (version != null) {
          delete.where(eq(VERSION_COL, version));
        }
      }
    }

    return delete;
View Full Code Here

        FieldInformation keyField = classInformations.getKeyInformation();
        if (classInformations.isComplexKey()) {
            runComplexKey(delete, key, keyField.getSubFields().getFields());
        } else {
            delete.where(QueryBuilder.eq(keyField.getName(), key));
        }

        delete.setConsistencyLevel(consistency);
        return delete;
    }
View Full Code Here

            // not found
            return;
        }

        Delete deleteStatement = delete().from(tableName);
        deleteStatement
                .where(eq(partitionKeyColumnName, rowKey))
                .and(eq(pathColumnName, bindMarker()));

        batch = batchContext == null ? batch() : batch;
        List<Object> bindArguments = batchContext == null ?
View Full Code Here

            case DEL:
                {
                    Delete delete = table == null
                                  ? delete().all().from(mapper.getKeyspace(), mapper.getTable())
                                  : delete().all().from(table);
                    Delete.Where where = delete.where();
                    for (int i = 0; i < mapper.primaryKeySize(); i++)
                        where.and(eq(mapper.getPrimaryKeyColumn(i).getColumnName(), bindMarker()));
                    return delete.toString();
                }
            case SLICE:
View Full Code Here

    Assert.notNull(id);

    CassandraPersistentEntity<?> entity = mappingContext.getPersistentEntity(type);

    Delete delete = QueryBuilder.delete().from(entity.getTableName().toCql());
    appendIdCriteria(delete.where(), entity, id);

    execute(delete);
  }

  @Override
View Full Code Here

  public static Delete createDeleteQuery(String tableName, Object object, QueryOptions options,
      EntityWriter<Object, Object> entityWriter) {

    Delete.Selection ds = QueryBuilder.delete();
    Delete delete = ds.from(tableName);
    Where w = delete.where();
    entityWriter.write(object, w);
    CqlTemplate.addQueryOptions(delete, options);
    return delete;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.