Entities are partitioned into subsets, identified by a partition ID.
Queries are scoped to a single partition.
This partition ID is normalized with the standard default context
partition ID.
Entities are partitioned into subsets, identified by a partition ID.
Queries are scoped to a single partition.
This partition ID is normalized with the standard default context
partition ID.
Entities are partitioned into subsets, identified by a partition ID.
Queries are scoped to a single partition.
This partition ID is normalized with the standard default context
partition ID.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface RunQueryRequestOrBuilder (2.31.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.31.2 (latest)](/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.31.1](/java/docs/reference/google-cloud-datastore/2.31.1/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.30.0](/java/docs/reference/google-cloud-datastore/2.30.0/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.29.1](/java/docs/reference/google-cloud-datastore/2.29.1/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.28.2](/java/docs/reference/google-cloud-datastore/2.28.2/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.27.1](/java/docs/reference/google-cloud-datastore/2.27.1/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.26.4](/java/docs/reference/google-cloud-datastore/2.26.4/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.25.2](/java/docs/reference/google-cloud-datastore/2.25.2/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.24.3](/java/docs/reference/google-cloud-datastore/2.24.3/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.23.0](/java/docs/reference/google-cloud-datastore/2.23.0/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.22.0](/java/docs/reference/google-cloud-datastore/2.22.0/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.21.3](/java/docs/reference/google-cloud-datastore/2.21.3/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.20.2](/java/docs/reference/google-cloud-datastore/2.20.2/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.19.2](/java/docs/reference/google-cloud-datastore/2.19.2/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.18.5](/java/docs/reference/google-cloud-datastore/2.18.5/com.google.datastore.v1.RunQueryRequestOrBuilder)\n- [2.17.6](/java/docs/reference/google-cloud-datastore/2.17.6/com.google.datastore.v1.RunQueryRequestOrBuilder) \n\n public interface RunQueryRequestOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getDatabaseId()\n\n public abstract String getDatabaseId()\n\nThe ID of the database against which to make the request.\n\n'(default)' is not allowed; please use empty string '' to refer the default\ndatabase.\n\n`string database_id = 9;`\n\n### getDatabaseIdBytes()\n\n public abstract ByteString getDatabaseIdBytes()\n\nThe ID of the database against which to make the request.\n\n'(default)' is not allowed; please use empty string '' to refer the default\ndatabase.\n\n`string database_id = 9;`\n\n### getExplainOptions()\n\n public abstract ExplainOptions getExplainOptions()\n\nOptional. Explain options for the query. If set, additional query\nstatistics will be returned. If not, only query results will be returned.\n\n`\n.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getExplainOptionsOrBuilder()\n\n public abstract ExplainOptionsOrBuilder getExplainOptionsOrBuilder()\n\nOptional. Explain options for the query. If set, additional query\nstatistics will be returned. If not, only query results will be returned.\n\n`\n.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### getGqlQuery()\n\n public abstract GqlQuery getGqlQuery()\n\nThe GQL query to run. This query must be a non-aggregation query.\n\n`.google.datastore.v1.GqlQuery gql_query = 7;`\n\n### getGqlQueryOrBuilder()\n\n public abstract GqlQueryOrBuilder getGqlQueryOrBuilder()\n\nThe GQL query to run. This query must be a non-aggregation query.\n\n`.google.datastore.v1.GqlQuery gql_query = 7;`\n\n### getPartitionId()\n\n public abstract PartitionId getPartitionId()\n\nEntities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID.\n\n`.google.datastore.v1.PartitionId partition_id = 2;`\n\n### getPartitionIdOrBuilder()\n\n public abstract PartitionIdOrBuilder getPartitionIdOrBuilder()\n\nEntities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID.\n\n`.google.datastore.v1.PartitionId partition_id = 2;`\n\n### getProjectId()\n\n public abstract String getProjectId()\n\nRequired. The ID of the project against which to make the request.\n\n`string project_id = 8 [(.google.api.field_behavior) = REQUIRED];`\n\n### getProjectIdBytes()\n\n public abstract ByteString getProjectIdBytes()\n\nRequired. The ID of the project against which to make the request.\n\n`string project_id = 8 [(.google.api.field_behavior) = REQUIRED];`\n\n### getPropertyMask()\n\n public abstract PropertyMask getPropertyMask()\n\nThe properties to return.\nThis field must not be set for a projection query.\n\nSee\nLookupRequest.property_mask.\n\n`.google.datastore.v1.PropertyMask property_mask = 10;`\n\n### getPropertyMaskOrBuilder()\n\n public abstract PropertyMaskOrBuilder getPropertyMaskOrBuilder()\n\nThe properties to return.\nThis field must not be set for a projection query.\n\nSee\nLookupRequest.property_mask.\n\n`.google.datastore.v1.PropertyMask property_mask = 10;`\n\n### getQuery()\n\n public abstract Query getQuery()\n\nThe query to run.\n\n`.google.datastore.v1.Query query = 3;`\n\n### getQueryOrBuilder()\n\n public abstract QueryOrBuilder getQueryOrBuilder()\n\nThe query to run.\n\n`.google.datastore.v1.Query query = 3;`\n\n### getQueryTypeCase()\n\n public abstract RunQueryRequest.QueryTypeCase getQueryTypeCase()\n\n### getReadOptions()\n\n public abstract ReadOptions getReadOptions()\n\nThe options for this query.\n\n`.google.datastore.v1.ReadOptions read_options = 1;`\n\n### getReadOptionsOrBuilder()\n\n public abstract ReadOptionsOrBuilder getReadOptionsOrBuilder()\n\nThe options for this query.\n\n`.google.datastore.v1.ReadOptions read_options = 1;`\n\n### hasExplainOptions()\n\n public abstract boolean hasExplainOptions()\n\nOptional. Explain options for the query. If set, additional query\nstatistics will be returned. If not, only query results will be returned.\n\n`\n.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];\n`\n\n### hasGqlQuery()\n\n public abstract boolean hasGqlQuery()\n\nThe GQL query to run. This query must be a non-aggregation query.\n\n`.google.datastore.v1.GqlQuery gql_query = 7;`\n\n### hasPartitionId()\n\n public abstract boolean hasPartitionId()\n\nEntities are partitioned into subsets, identified by a partition ID.\nQueries are scoped to a single partition.\nThis partition ID is normalized with the standard default context\npartition ID.\n\n`.google.datastore.v1.PartitionId partition_id = 2;`\n\n### hasPropertyMask()\n\n public abstract boolean hasPropertyMask()\n\nThe properties to return.\nThis field must not be set for a projection query.\n\nSee\nLookupRequest.property_mask.\n\n`.google.datastore.v1.PropertyMask property_mask = 10;`\n\n### hasQuery()\n\n public abstract boolean hasQuery()\n\nThe query to run.\n\n`.google.datastore.v1.Query query = 3;`\n\n### hasReadOptions()\n\n public abstract boolean hasReadOptions()\n\nThe options for this query.\n\n`.google.datastore.v1.ReadOptions read_options = 1;`"]]