# Interface RunQueryRequestOrBuilder (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public interface RunQueryRequestOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getDatabaseId()

    public abstract String getDatabaseId()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default
database.

`string database_id = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The databaseId. |

### getDatabaseIdBytes()

    public abstract ByteString getDatabaseIdBytes()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default
database.

`string database_id = 9;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for databaseId. |

### getExplainOptions()

    public abstract ExplainOptions getExplainOptions()

Optional. Explain options for the query. If set, additional query
statistics will be returned. If not, only query results will be returned.

`
.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ExplainOptions` | The explainOptions. |

### getExplainOptionsOrBuilder()

    public abstract ExplainOptionsOrBuilder getExplainOptionsOrBuilder()

Optional. Explain options for the query. If set, additional query
statistics will be returned. If not, only query results will be returned.

`
.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ExplainOptionsOrBuilder` |   |

### getGqlQuery()

    public abstract GqlQuery getGqlQuery()

The GQL query to run. This query must be a non-aggregation query.

`.google.datastore.v1.GqlQuery gql_query = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.GqlQuery` | The gqlQuery. |

### getGqlQueryOrBuilder()

    public abstract GqlQueryOrBuilder getGqlQueryOrBuilder()

The GQL query to run. This query must be a non-aggregation query.

`.google.datastore.v1.GqlQuery gql_query = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.GqlQueryOrBuilder` |   |

### getPartitionId()

    public abstract PartitionId getPartitionId()

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.

`.google.datastore.v1.PartitionId partition_id = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.PartitionId` | The partitionId. |

### getPartitionIdOrBuilder()

    public abstract PartitionIdOrBuilder getPartitionIdOrBuilder()

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.

`.google.datastore.v1.PartitionId partition_id = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.PartitionIdOrBuilder` |   |

### getProjectId()

    public abstract String getProjectId()

Required. The ID of the project against which to make the request.

`string project_id = 8 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The projectId. |

### getProjectIdBytes()

    public abstract ByteString getProjectIdBytes()

Required. The ID of the project against which to make the request.

`string project_id = 8 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for projectId. |

### getPropertyMask()

    public abstract PropertyMask getPropertyMask()

The properties to return.
This field must not be set for a projection query.

See
LookupRequest.property_mask.

`.google.datastore.v1.PropertyMask property_mask = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.PropertyMask` | The propertyMask. |

### getPropertyMaskOrBuilder()

    public abstract PropertyMaskOrBuilder getPropertyMaskOrBuilder()

The properties to return.
This field must not be set for a projection query.

See
LookupRequest.property_mask.

`.google.datastore.v1.PropertyMask property_mask = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.PropertyMaskOrBuilder` |   |

### getQuery()

    public abstract Query getQuery()

The query to run.

`.google.datastore.v1.Query query = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.Query` | The query. |

### getQueryOrBuilder()

    public abstract QueryOrBuilder getQueryOrBuilder()

The query to run.

`.google.datastore.v1.Query query = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.QueryOrBuilder` |   |

### getQueryTypeCase()

    public abstract RunQueryRequest.QueryTypeCase getQueryTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunQueryRequest.QueryTypeCase` |   |

### getReadOptions()

    public abstract ReadOptions getReadOptions()

The options for this query.

`.google.datastore.v1.ReadOptions read_options = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReadOptions` | The readOptions. |

### getReadOptionsOrBuilder()

    public abstract ReadOptionsOrBuilder getReadOptionsOrBuilder()

The options for this query.

`.google.datastore.v1.ReadOptions read_options = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReadOptionsOrBuilder` |   |

### hasExplainOptions()

    public abstract boolean hasExplainOptions()

Optional. Explain options for the query. If set, additional query
statistics will be returned. If not, only query results will be returned.

`
.google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the explainOptions field is set. |

### hasGqlQuery()

    public abstract boolean hasGqlQuery()

The GQL query to run. This query must be a non-aggregation query.

`.google.datastore.v1.GqlQuery gql_query = 7;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the gqlQuery field is set. |

### hasPartitionId()

    public abstract boolean hasPartitionId()

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.

`.google.datastore.v1.PartitionId partition_id = 2;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the partitionId field is set. |

### hasPropertyMask()

    public abstract boolean hasPropertyMask()

The properties to return.
This field must not be set for a projection query.

See
LookupRequest.property_mask.

`.google.datastore.v1.PropertyMask property_mask = 10;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the propertyMask field is set. |

### hasQuery()

    public abstract boolean hasQuery()

The query to run.

`.google.datastore.v1.Query query = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the query field is set. |

### hasReadOptions()

    public abstract boolean hasReadOptions()

The options for this query.

`.google.datastore.v1.ReadOptions read_options = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the readOptions field is set. |