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


Java TableQuery.generateFilterCondition方法代码示例

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


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

示例1: generateCombinedFilterConditions

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
public String generateCombinedFilterConditions() {
    String filter = "";
    if (isValidFilterExpession()) {
        for (int idx = 0; idx < column.getValue().size(); idx++) {
            String c = column.getValue().get(idx);
            String cfn = function.getValue().get(idx);
            String cop = predicate.getValue().get(idx);
            String typ = fieldType.getValue().get(idx);

            String f = Comparison.getQueryComparisons(cfn);
            String v = operand.getValue().get(idx);
            String p = Predicate.getOperator(cop);

            EdmType t = SupportedFieldType.getEdmType(typ);

            String flt = TableQuery.generateFilterCondition(c, f, v, t);

            if (!filter.isEmpty()) {
                filter = TableQuery.combineFilters(filter, p, flt);
            } else {
                filter = flt;
            }
        }
    }
    return filter;
}
 
开发者ID:Talend,项目名称:components,代码行数:27,代码来源:FilterExpressionTable.java

示例2: BasicQuery

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
/**
 * Illustrates how to form and execute a query operation.
 * 
 * @throws StorageException
 */
public static void BasicQuery() throws StorageException {
    // Retrieve a single entity.
    // Retrieve the entity with partition key of "Smith" and row key of "Jeff".
    TableOperation retrieveSmithJeff = TableOperation.retrieve("Smith", "Jeff", CustomerEntity.class);

    // Submit the operation to the table service and get the specific entity.
    @SuppressWarnings("unused")
    CustomerEntity specificEntity = table.execute(retrieveSmithJeff).getResultAsType();

    // Retrieve all entities in a partition.
    // Create a filter condition where the partition key is "Smith".
    String partitionFilter = TableQuery.generateFilterCondition("PartitionKey", QueryComparisons.EQUAL, "Smith");

    // Specify a partition query, using "Smith" as the partition key filter.
    TableQuery<CustomerEntity> partitionQuery = TableQuery.from(CustomerEntity.class).where(partitionFilter);

    // Loop through the results, displaying information about the entity.
    for (CustomerEntity entity : table.execute(partitionQuery)) {
        System.out.println(entity.getPartitionKey() + " " + entity.getRowKey() + "\t" + entity.getEmail() + "\t"
                + entity.getPhoneNumber());
    }
}
 
开发者ID:Azure,项目名称:azure-storage-java,代码行数:28,代码来源:TableBasics.java

示例3: deleteVreAuthorizations

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
@Override
public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException {
  String condition = TableQuery.generateFilterCondition(
    "PartitionKey",
    TableQuery.QueryComparisons.EQUAL,
    vreId
  );

  TableBatchOperation deletes = new TableBatchOperation();
  for (DynamicTableEntity entity : table.execute(TableQuery.from(DynamicTableEntity.class).where(condition))) {
    deletes.delete(entity);
  }

  try {
    table.execute(deletes);
  } catch (StorageException e) {
    LOG.error("deleteVreAuthorizations failed", e);
    throw new AuthorizationUnavailableException("Could not delete authorizations");
  }
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:21,代码来源:AzureVreAuthorizationAccess.java

示例4: partitionKeyEquals

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
private static String partitionKeyEquals(ServiceId serviceId) {
    return TableQuery
            .generateFilterCondition(
                    PARTITION_KEY,
                    TableQuery.QueryComparisons.EQUAL,
                    serviceId.getId());
}
 
开发者ID:yammer,项目名称:breakerbox,代码行数:8,代码来源:AzureStore.java

示例5: timestampEquals

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
private static String timestampEquals(long timestamp) {
    return TableQuery.generateFilterCondition(
            ROW_KEY,
            TableQuery.QueryComparisons.EQUAL,
            String.valueOf(timestamp)
    );
}
 
开发者ID:yammer,项目名称:breakerbox,代码行数:8,代码来源:AzureStore.java

示例6: createPartitionAndRowQuery

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
/**
 * Create a filter condition that returns log lines between two dates. Designed to be used in addition to other criteria
 *
 * @param from
 * @param to
 *
 * @return
 */
public String createPartitionAndRowQuery(final DateTime from, final DateTime to)
{
	final String parMin = TableQuery.generateFilterCondition("PartitionKey",
	                                                         TableQuery.QueryComparisons.GREATER_THAN_OR_EQUAL,
	                                                         from.toLocalDate().toString());

	final String rowMin = TableQuery.generateFilterCondition("RowKey",
	                                                         TableQuery.QueryComparisons.GREATER_THAN_OR_EQUAL,
	                                                         LogLineTableEntity.toRowKey(from, null));

	if (to == null || from.toLocalDate().equals(to.toLocalDate()) || to.isAfterNow())
	{
		// There's no upper bound (or the upper bound doesn't make sense to include in the query)
		return andFilters(parMin, rowMin);
	}
	else
	{
		// From and To required

		final String parMax = TableQuery.generateFilterCondition("PartitionKey",
		                                                         TableQuery.QueryComparisons.LESS_THAN,
		                                                         to.toLocalDate().plusDays(1).toString());

		final String rowMax = TableQuery.generateFilterCondition("RowKey",
		                                                         TableQuery.QueryComparisons.LESS_THAN,
		                                                         LogLineTableEntity.toRowKey(to.plusSeconds(1), null));

		return andFilters(parMin, parMax, rowMin, rowMax);
	}
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:39,代码来源:AzureLogStore.java

示例7: getEntitiesWithPartition

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
/**
 * Retrieve all rows in a table with the given partition key.
 * @param partitionKey Job model version of the processors to be retrieved.
 * @return Iterable list of processor entities.
 */
public Iterable<ProcessorEntity> getEntitiesWithPartition(String partitionKey) {
  String partitionFilter = TableQuery.generateFilterCondition(PARTITION_KEY, TableQuery.QueryComparisons.EQUAL, partitionKey);
  TableQuery<ProcessorEntity> partitionQuery = TableQuery.from(ProcessorEntity.class).where(partitionFilter);
  return table.execute(partitionQuery);
}
 
开发者ID:apache,项目名称:samza,代码行数:11,代码来源:TableUtils.java

示例8: serviceIdEquals

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
private static String serviceIdEquals(ServiceId serviceId) {
    return TableQuery.generateFilterCondition(
            "ServiceName",
            TableQuery.QueryComparisons.EQUAL,
            serviceId.getId());
}
 
开发者ID:yammer,项目名称:breakerbox,代码行数:7,代码来源:AzureStore.java

示例9: partitionEquals

import com.microsoft.azure.storage.table.TableQuery; //导入方法依赖的package包/类
private static String partitionEquals(DependencyId dependencyId) {
    return TableQuery.generateFilterCondition(
            PARTITION_KEY,
            TableQuery.QueryComparisons.EQUAL,
            dependencyId.getId());
}
 
开发者ID:yammer,项目名称:breakerbox,代码行数:7,代码来源:AzureStore.java


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