本文整理了Java中com.google.cloud.datastore.Query.populatePb
方法的一些代码示例,展示了Query.populatePb
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.populatePb
方法的具体详情如下:
包路径:com.google.cloud.datastore.Query
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!