本文整理汇总了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);
}
示例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);
}
示例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);
}