com.google.gcloud.datastore.Query Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gcloud-java-datastore Show documentation
Show all versions of gcloud-java-datastore Show documentation
Java idiomatic client for Google Cloud Datastore.
The newest version!
/*
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gcloud.datastore;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.collect.Maps;
import com.google.protobuf.GeneratedMessage;
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.Map;
/**
* A Google Cloud Datastore query.
* For usage examples see {@link GqlQuery} and {@link StructuredQuery}.
*
* Note that queries require proper indexing. See
*
* Cloud Datastore Index Configuration for help configuring indexes.
*
* @param the type of the values returned by this query.
* @see Datastore Queries
*/
public abstract class Query extends Serializable {
private static final long serialVersionUID = -2748141759901313101L;
private final ResultType resultType;
private final String namespace;
/**
* This class represents the expected type of the result.
* ENTITY: A full entity represented by {@link Entity}.
* PROJECTION_ENTITY: A projection entity, represented by {@link ProjectionEntity}.
* KEY: An entity's {@link Key}.
*/
public abstract static class ResultType implements java.io.Serializable {
private static final long serialVersionUID = 2104157695425806623L;
private static final Map>
PB_TO_INSTANCE = Maps.newEnumMap(
com.google.datastore.v1beta3.EntityResult.ResultType.class);
static final ResultType> UNKNOWN =
new ResultType
© 2015 - 2025 Weber Informatics LLC | Privacy Policy