com.google.cloud.datastore.Query.populatePb()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中com.google.cloud.datastore.Query.populatePb方法的一些代码示例,展示了Query.populatePb的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.populatePb方法的具体详情如下:
包路径:com.google.cloud.datastore.Query
类名称:Query
方法名:populatePb

Query.populatePb介绍

暂无

代码示例

代码示例来源:origin: googleapis/google-cloud-java

private void sendRequest() {
 com.google.datastore.v1.RunQueryRequest.Builder requestPb =
   com.google.datastore.v1.RunQueryRequest.newBuilder();
 if (readOptionsPb != null) {
  requestPb.setReadOptions(readOptionsPb);
 }
 requestPb.setPartitionId(partitionIdPb);
 query.populatePb(requestPb);
 runQueryResponsePb = datastore.runQuery(requestPb.build());
 mostRecentQueryPb = runQueryResponsePb.getQuery();
 if (mostRecentQueryPb == null) {
  mostRecentQueryPb = requestPb.getQuery();
 }
 lastBatch = runQueryResponsePb.getBatch().getMoreResults() != MoreResultsType.NOT_FINISHED;
 entityResultPbIter = runQueryResponsePb.getBatch().getEntityResultsList().iterator();
 actualResultType = ResultType.fromPb(runQueryResponsePb.getBatch().getEntityResultType());
 if (Objects.equals(queryResultType, ResultType.PROJECTION_ENTITY)) {
  // projection entity can represent all type of results
  actualResultType = ResultType.PROJECTION_ENTITY;
 }
 Preconditions.checkState(
   queryResultType.isAssignableFrom(actualResultType),
   "Unexpected result type " + actualResultType + " vs " + queryResultType);
}

代码示例来源:origin: googleapis/google-cloud-java

Query<Key> query = Query.newKeyQueryBuilder().build();
RunQueryRequest.Builder requestPb = RunQueryRequest.newBuilder();
query.populatePb(requestPb);
QueryResultBatch queryResultBatchPb =
  RunQueryResponse.newBuilder()

代码示例来源:origin: googleapis/google-cloud-java

Query<Entity> query = Query.newEntityQueryBuilder().build();
RunQueryRequest.Builder requestPb = RunQueryRequest.newBuilder();
query.populatePb(requestPb);
QueryResultBatch queryResultBatchPb =
  RunQueryResponse.newBuilder()

代码示例来源:origin: com.google.cloud/google-cloud-datastore

private void sendRequest() {
 com.google.datastore.v1.RunQueryRequest.Builder requestPb =
   com.google.datastore.v1.RunQueryRequest.newBuilder();
 if (readOptionsPb != null) {
  requestPb.setReadOptions(readOptionsPb);
 }
 requestPb.setPartitionId(partitionIdPb);
 query.populatePb(requestPb);
 runQueryResponsePb = datastore.runQuery(requestPb.build());
 mostRecentQueryPb = runQueryResponsePb.getQuery();
 if (mostRecentQueryPb == null) {
  mostRecentQueryPb = requestPb.getQuery();
 }
 lastBatch = runQueryResponsePb.getBatch().getMoreResults() != MoreResultsType.NOT_FINISHED;
 entityResultPbIter = runQueryResponsePb.getBatch().getEntityResultsList().iterator();
 actualResultType = ResultType.fromPb(runQueryResponsePb.getBatch().getEntityResultType());
 if (Objects.equals(queryResultType, ResultType.PROJECTION_ENTITY)) {
  // projection entity can represent all type of results
  actualResultType = ResultType.PROJECTION_ENTITY;
 }
 Preconditions.checkState(
   queryResultType.isAssignableFrom(actualResultType),
   "Unexpected result type " + actualResultType + " vs " + queryResultType);
}

相关文章