当前位置: 首页>>代码示例>>Java>>正文


Java Select.allowFiltering方法代码示例

本文整理汇总了Java中com.datastax.driver.core.querybuilder.Select.allowFiltering方法的典型用法代码示例。如果您正苦于以下问题:Java Select.allowFiltering方法的具体用法?Java Select.allowFiltering怎么用?Java Select.allowFiltering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.datastax.driver.core.querybuilder.Select的用法示例。


在下文中一共展示了Select.allowFiltering方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSelectObjectQuery

import com.datastax.driver.core.querybuilder.Select; //导入方法依赖的package包/类
/**
 * This method returns the CQL Select query to retrieve data from the table.
 * refer: http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
 *
 * @param mapping   Cassandra Mapping {@link CassandraMapping}
 * @param keyFields key fields
 * @return CQL Query
 */
static String getSelectObjectQuery(CassandraMapping mapping, List<String> keyFields) {
  Select select = QueryBuilder.select().from(mapping.getKeySpace().getName(), mapping.getCoreName());
  if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
    select.allowFiltering();
  }
  String[] columnNames = getColumnNames(mapping, keyFields);
  return processKeys(columnNames, select);
}
 
开发者ID:apache,项目名称:gora,代码行数:17,代码来源:CassandraQueryFactory.java

示例2: getExecuteQuery

import com.datastax.driver.core.querybuilder.Select; //导入方法依赖的package包/类
/**
 * This method returns CQL Query for execute method. This CQL contains a Select Query to retrieve data from the table
 *
 * @param mapping        Cassandra Mapping {@link CassandraMapping}
 * @param cassandraQuery Query {@link CassandraQuery}
 * @param objects        object list
 * @return CQL Query
 */
static String getExecuteQuery(CassandraMapping mapping, Query cassandraQuery, List<Object> objects, String[] fields) {
  long limit = cassandraQuery.getLimit();
  Select select = QueryBuilder.select(getColumnNames(mapping, Arrays.asList(fields))).from(mapping.getKeySpace().getName(), mapping.getCoreName());
  if (limit > 0) {
    select = select.limit((int) limit);
  }
  if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
    select.allowFiltering();
  }
  return processQuery(cassandraQuery, select, mapping, objects);
}
 
开发者ID:apache,项目名称:gora,代码行数:20,代码来源:CassandraQueryFactory.java

示例3: getSelectObjectWithFieldsQuery

import com.datastax.driver.core.querybuilder.Select; //导入方法依赖的package包/类
/**
 * This method returns CQL Select query to retrieve data from the table with given fields.
 * This method is used for Avro Serialization
 * refer: http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlSelect.html
 *
 * @param mapping   Cassandra Mapping {@link CassandraMapping}
 * @param fields    Given fields to retrieve
 * @param keyFields key fields
 * @return CQL Query
 */
static String getSelectObjectWithFieldsQuery(CassandraMapping mapping, String[] fields, List<String> keyFields) {
  Select select = QueryBuilder.select(getColumnNames(mapping, Arrays.asList(fields))).from(mapping.getKeySpace().getName(), mapping.getCoreName());
  if (Boolean.parseBoolean(mapping.getProperty("allowFiltering"))) {
    select.allowFiltering();
  }
  String[] columnNames = getColumnNames(mapping, keyFields);
  return processKeys(columnNames, select);
}
 
开发者ID:apache,项目名称:gora,代码行数:19,代码来源:CassandraQueryFactory.java


注:本文中的com.datastax.driver.core.querybuilder.Select.allowFiltering方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。