Package com.datastax.driver.core.querybuilder

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


    if (dataRequest.getMaxTimestamp() != Long.MAX_VALUE) {
      select.where(lt(VERSION_COL, dataRequest.getMaxTimestamp()));
    }

    if (dataRequest.getMinTimestamp() != 0L) {
      select.where(gte(VERSION_COL, dataRequest.getMinTimestamp()));
    }

    select.setFetchSize(
        columnRequest.getPageSize() == 0 ? Integer.MAX_VALUE : columnRequest.getPageSize());
View Full Code Here


    select.setFetchSize(
        columnRequest.getPageSize() == 0 ? Integer.MAX_VALUE : columnRequest.getPageSize());

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

    return select;
  }
View Full Code Here

    }

    final Select select = selection.from(table.getKeyspace(), table.getTable());

    if (options.hasStartToken()) {
      select.where(gte(tokenColumn, options.getStartToken()));
    }

    if (options.hasStopToken()) {
      select.where(lt(tokenColumn, options.getStopToken()));
    }
View Full Code Here

    if (options.hasStartToken()) {
      select.where(gte(tokenColumn, options.getStartToken()));
    }

    if (options.hasStopToken()) {
      select.where(lt(tokenColumn, options.getStopToken()));
    }

    select.setFetchSize(ENTITY_ID_BATCH_SIZE);

    return select;
View Full Code Here

        String rowKeyString = StandardConverters.convertFromBytes(String.class, rowKey);

        for (byte[] val : values) {
            Select selectQuery = QueryBuilder.select().all().from(keySpace, indTable).allowFiltering();
            Where selectWhere = selectQuery.where();
            Clause rkClause = QueryBuilder.eq("id", rowKeyString);
            selectWhere.and(rkClause);

            Object value = null;
            value = columnMeta.getStorageType().convertFromNoSql(val);
View Full Code Here

    }

    public boolean findIndexRow(String table, String rowKey, byte[] key) {
        Select selectQuery = QueryBuilder.select().all().from(keys, table).allowFiltering();
        //Where whereClause = Cql3Util.createRowQuery(from, to, columnMeta, selectQuery, rowKeyString);
        Where selectWhere = selectQuery.where();
        Clause rkClause = QueryBuilder.eq("id", rowKey);
        selectWhere.and(rkClause);
        Clause keyClause = QueryBuilder.lte("colvalue", ByteBuffer.wrap(key));
        selectWhere.and(keyClause);
        Query query = selectWhere.limit(1);
View Full Code Here

        .format("select * from %s where title in (%s)", TABLE, StringUtils.arrayToCommaDelimitedString(quoted));
  }

  public static Select select(String isbn) {
    Select select = QueryBuilder.select("isbn", "title").from(TABLE);
    select.where(QueryBuilder.eq("isbn", isbn));
    return select;
  }

  public static final Comparator<Book> BOOK_COMPARATOR = new Comparator<Book>() {
    @Override
View Full Code Here

    b1.setCheckOuts(checkOutMap);

    template.insert(b1);

    Select select = QueryBuilder.select().all().from("bookHistory");
    select.where(QueryBuilder.eq("isbn", "123456-1"));

    BookHistory b = template.selectOne(select, BookHistory.class);

    Assert.assertNotNull(b.getCheckOuts());
View Full Code Here

    b1.setBookmarks(marks);

    template.insert(b1);

    Select select = QueryBuilder.select().all().from("bookReference");
    select.where(QueryBuilder.eq("isbn", "123456-1"));

    BookReference b = template.selectOne(select, BookReference.class);

    Assert.assertNotNull(b.getReferences());
    Assert.assertNotNull(b.getBookmarks());
View Full Code Here

        int limit = fullPartitionKey ? 1 : limitForPartitionKeySelect;
        Select partitionKeys = CassandraCqlUtils.selectDistinctFrom(tableHandle, partitionKeyColumns);
        partitionKeys.limit(limit);
        partitionKeys.setFetchSize(fetchSizeForPartitionKeySelect);
        addWhereClause(partitionKeys.where(), partitionKeyColumns, filterPrefix);
        ResultSetFuture partitionKeyFuture = session.executeAsync(partitionKeys);

        if (!fullPartitionKey) {
            long count = countFuture.getUninterruptibly().one().getLong(0);
            if (count == limitForPartitionKeySelect) {
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.