Class Query.Builder (2.25.2)

publicstaticfinalclass Query.BuilderextendsGeneratedMessageV3.Builder<Query.Builder>implementsQueryOrBuilder

A query for entities.

The query stages are executed in the following order:

  1. kind
  2. filter
  3. projection
  4. order + start_cursor + end_cursor
  5. offset
  6. limit
  7. find_nearest

Protobuf type google.datastore.v1.Query

Implements

QueryOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllDistinctOn(Iterable<? extends PropertyReference> values)

publicQuery.BuilderaddAllDistinctOn(Iterable<?extendsPropertyReference>values)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
values Iterable<? extends com.google.datastore.v1.PropertyReference>
Returns
Type Description
Query.Builder

addAllKind(Iterable<? extends KindExpression> values)

publicQuery.BuilderaddAllKind(Iterable<?extendsKindExpression>values)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
values Iterable<? extends com.google.datastore.v1.KindExpression>
Returns
Type Description
Query.Builder

addAllOrder(Iterable<? extends PropertyOrder> values)

publicQuery.BuilderaddAllOrder(Iterable<?extendsPropertyOrder>values)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
values Iterable<? extends com.google.datastore.v1.PropertyOrder>
Returns
Type Description
Query.Builder

addAllProjection(Iterable<? extends Projection> values)

publicQuery.BuilderaddAllProjection(Iterable<?extendsProjection>values)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
values Iterable<? extends com.google.datastore.v1.Projection>
Returns
Type Description
Query.Builder

addDistinctOn(PropertyReference value)

publicQuery.BuilderaddDistinctOn(PropertyReferencevalue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
value PropertyReference
Returns
Type Description
Query.Builder

addDistinctOn(PropertyReference.Builder builderForValue)

publicQuery.BuilderaddDistinctOn(PropertyReference.BuilderbuilderForValue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
builderForValue PropertyReference.Builder
Returns
Type Description
Query.Builder

addDistinctOn(int index, PropertyReference value)

publicQuery.BuilderaddDistinctOn(intindex,PropertyReferencevalue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameters
Name Description
index int
value PropertyReference
Returns
Type Description
Query.Builder

addDistinctOn(int index, PropertyReference.Builder builderForValue)

publicQuery.BuilderaddDistinctOn(intindex,PropertyReference.BuilderbuilderForValue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameters
Name Description
index int
builderForValue PropertyReference.Builder
Returns
Type Description
Query.Builder

addDistinctOnBuilder()

publicPropertyReference.BuilderaddDistinctOnBuilder()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
PropertyReference.Builder

addDistinctOnBuilder(int index)

publicPropertyReference.BuilderaddDistinctOnBuilder(intindex)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
index int
Returns
Type Description
PropertyReference.Builder

addKind(KindExpression value)

publicQuery.BuilderaddKind(KindExpressionvalue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
value KindExpression
Returns
Type Description
Query.Builder

addKind(KindExpression.Builder builderForValue)

publicQuery.BuilderaddKind(KindExpression.BuilderbuilderForValue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
builderForValue KindExpression.Builder
Returns
Type Description
Query.Builder

addKind(int index, KindExpression value)

publicQuery.BuilderaddKind(intindex,KindExpressionvalue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameters
Name Description
index int
value KindExpression
Returns
Type Description
Query.Builder

addKind(int index, KindExpression.Builder builderForValue)

publicQuery.BuilderaddKind(intindex,KindExpression.BuilderbuilderForValue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameters
Name Description
index int
builderForValue KindExpression.Builder
Returns
Type Description
Query.Builder

addKindBuilder()

publicKindExpression.BuilderaddKindBuilder()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
KindExpression.Builder

addKindBuilder(int index)

publicKindExpression.BuilderaddKindBuilder(intindex)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
index int
Returns
Type Description
KindExpression.Builder

addOrder(PropertyOrder value)

publicQuery.BuilderaddOrder(PropertyOrdervalue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
value PropertyOrder
Returns
Type Description
Query.Builder

addOrder(PropertyOrder.Builder builderForValue)

publicQuery.BuilderaddOrder(PropertyOrder.BuilderbuilderForValue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
builderForValue PropertyOrder.Builder
Returns
Type Description
Query.Builder

addOrder(int index, PropertyOrder value)

publicQuery.BuilderaddOrder(intindex,PropertyOrdervalue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameters
Name Description
index int
value PropertyOrder
Returns
Type Description
Query.Builder

addOrder(int index, PropertyOrder.Builder builderForValue)

publicQuery.BuilderaddOrder(intindex,PropertyOrder.BuilderbuilderForValue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameters
Name Description
index int
builderForValue PropertyOrder.Builder
Returns
Type Description
Query.Builder

addOrderBuilder()

publicPropertyOrder.BuilderaddOrderBuilder()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
PropertyOrder.Builder

addOrderBuilder(int index)

publicPropertyOrder.BuilderaddOrderBuilder(intindex)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
index int
Returns
Type Description
PropertyOrder.Builder

addProjection(Projection value)

publicQuery.BuilderaddProjection(Projectionvalue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
value Projection
Returns
Type Description
Query.Builder

addProjection(Projection.Builder builderForValue)

publicQuery.BuilderaddProjection(Projection.BuilderbuilderForValue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
builderForValue Projection.Builder
Returns
Type Description
Query.Builder

addProjection(int index, Projection value)

publicQuery.BuilderaddProjection(intindex,Projectionvalue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameters
Name Description
index int
value Projection
Returns
Type Description
Query.Builder

addProjection(int index, Projection.Builder builderForValue)

publicQuery.BuilderaddProjection(intindex,Projection.BuilderbuilderForValue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameters
Name Description
index int
builderForValue Projection.Builder
Returns
Type Description
Query.Builder

addProjectionBuilder()

publicProjection.BuilderaddProjectionBuilder()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
Projection.Builder

addProjectionBuilder(int index)

publicProjection.BuilderaddProjectionBuilder(intindex)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
index int
Returns
Type Description
Projection.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicQuery.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Query.Builder
Overrides

build()

publicQuerybuild()
Returns
Type Description
Query

buildPartial()

publicQuerybuildPartial()
Returns
Type Description
Query

clear()

publicQuery.Builderclear()
Returns
Type Description
Query.Builder
Overrides

clearDistinctOn()

publicQuery.BuilderclearDistinctOn()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
Query.Builder

clearEndCursor()

publicQuery.BuilderclearEndCursor()

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

bytes end_cursor = 8;

Returns
Type Description
Query.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicQuery.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Query.Builder
Overrides

clearFilter()

publicQuery.BuilderclearFilter()

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Returns
Type Description
Query.Builder

clearFindNearest()

publicQuery.BuilderclearFindNearest()

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Query.Builder

clearKind()

publicQuery.BuilderclearKind()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
Query.Builder

clearLimit()

publicQuery.BuilderclearLimit()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Returns
Type Description
Query.Builder

clearOffset()

publicQuery.BuilderclearOffset()

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

int32 offset = 10;

Returns
Type Description
Query.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicQuery.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Query.Builder
Overrides

clearOrder()

publicQuery.BuilderclearOrder()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
Query.Builder

clearProjection()

publicQuery.BuilderclearProjection()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
Query.Builder

clearStartCursor()

publicQuery.BuilderclearStartCursor()

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

bytes start_cursor = 7;

Returns
Type Description
Query.Builder

This builder for chaining.

clone()

publicQuery.Builderclone()
Returns
Type Description
Query.Builder
Overrides

getDefaultInstanceForType()

publicQuerygetDefaultInstanceForType()
Returns
Type Description
Query

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDistinctOn(int index)

publicPropertyReferencegetDistinctOn(intindex)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
index int
Returns
Type Description
PropertyReference

getDistinctOnBuilder(int index)

publicPropertyReference.BuildergetDistinctOnBuilder(intindex)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
index int
Returns
Type Description
PropertyReference.Builder

getDistinctOnBuilderList()

publicList<PropertyReference.Builder>getDistinctOnBuilderList()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
List<Builder>

getDistinctOnCount()

publicintgetDistinctOnCount()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
int

getDistinctOnList()

publicList<PropertyReference>getDistinctOnList()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
List<PropertyReference>

getDistinctOnOrBuilder(int index)

publicPropertyReferenceOrBuildergetDistinctOnOrBuilder(intindex)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
index int
Returns
Type Description
PropertyReferenceOrBuilder

getDistinctOnOrBuilderList()

publicList<?extendsPropertyReferenceOrBuilder>getDistinctOnOrBuilderList()

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Returns
Type Description
List<? extends com.google.datastore.v1.PropertyReferenceOrBuilder>

getEndCursor()

publicByteStringgetEndCursor()

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

bytes end_cursor = 8;

Returns
Type Description
ByteString

The endCursor.

getFilter()

publicFiltergetFilter()

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Returns
Type Description
Filter

The filter.

getFilterBuilder()

publicFilter.BuildergetFilterBuilder()

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Returns
Type Description
Filter.Builder

getFilterOrBuilder()

publicFilterOrBuildergetFilterOrBuilder()

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Returns
Type Description
FilterOrBuilder

getFindNearest()

publicFindNearestgetFindNearest()

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FindNearest

The findNearest.

getFindNearestBuilder()

publicFindNearest.BuildergetFindNearestBuilder()

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FindNearest.Builder

getFindNearestOrBuilder()

publicFindNearestOrBuildergetFindNearestOrBuilder()

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FindNearestOrBuilder

getKind(int index)

publicKindExpressiongetKind(intindex)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
index int
Returns
Type Description
KindExpression

getKindBuilder(int index)

publicKindExpression.BuildergetKindBuilder(intindex)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
index int
Returns
Type Description
KindExpression.Builder

getKindBuilderList()

publicList<KindExpression.Builder>getKindBuilderList()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
List<Builder>

getKindCount()

publicintgetKindCount()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
int

getKindList()

publicList<KindExpression>getKindList()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
List<KindExpression>

getKindOrBuilder(int index)

publicKindExpressionOrBuildergetKindOrBuilder(intindex)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
index int
Returns
Type Description
KindExpressionOrBuilder

getKindOrBuilderList()

publicList<?extendsKindExpressionOrBuilder>getKindOrBuilderList()

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Returns
Type Description
List<? extends com.google.datastore.v1.KindExpressionOrBuilder>

getLimit()

publicInt32ValuegetLimit()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Returns
Type Description
Int32Value

The limit.

getLimitBuilder()

publicInt32Value.BuildergetLimitBuilder()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Returns
Type Description
Builder

getLimitOrBuilder()

publicInt32ValueOrBuildergetLimitOrBuilder()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Returns
Type Description
Int32ValueOrBuilder

getOffset()

publicintgetOffset()

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

int32 offset = 10;

Returns
Type Description
int

The offset.

getOrder(int index)

publicPropertyOrdergetOrder(intindex)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
index int
Returns
Type Description
PropertyOrder

getOrderBuilder(int index)

publicPropertyOrder.BuildergetOrderBuilder(intindex)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
index int
Returns
Type Description
PropertyOrder.Builder

getOrderBuilderList()

publicList<PropertyOrder.Builder>getOrderBuilderList()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
List<Builder>

getOrderCount()

publicintgetOrderCount()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
int

getOrderList()

publicList<PropertyOrder>getOrderList()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
List<PropertyOrder>

getOrderOrBuilder(int index)

publicPropertyOrderOrBuildergetOrderOrBuilder(intindex)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
index int
Returns
Type Description
PropertyOrderOrBuilder

getOrderOrBuilderList()

publicList<?extendsPropertyOrderOrBuilder>getOrderOrBuilderList()

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Returns
Type Description
List<? extends com.google.datastore.v1.PropertyOrderOrBuilder>

getProjection(int index)

publicProjectiongetProjection(intindex)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
index int
Returns
Type Description
Projection

getProjectionBuilder(int index)

publicProjection.BuildergetProjectionBuilder(intindex)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
index int
Returns
Type Description
Projection.Builder

getProjectionBuilderList()

publicList<Projection.Builder>getProjectionBuilderList()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
List<Builder>

getProjectionCount()

publicintgetProjectionCount()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
int

getProjectionList()

publicList<Projection>getProjectionList()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
List<Projection>

getProjectionOrBuilder(int index)

publicProjectionOrBuildergetProjectionOrBuilder(intindex)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
index int
Returns
Type Description
ProjectionOrBuilder

getProjectionOrBuilderList()

publicList<?extendsProjectionOrBuilder>getProjectionOrBuilderList()

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Returns
Type Description
List<? extends com.google.datastore.v1.ProjectionOrBuilder>

getStartCursor()

publicByteStringgetStartCursor()

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

bytes start_cursor = 7;

Returns
Type Description
ByteString

The startCursor.

hasFilter()

publicbooleanhasFilter()

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Returns
Type Description
boolean

Whether the filter field is set.

hasFindNearest()

publicbooleanhasFindNearest()

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the findNearest field is set.

hasLimit()

publicbooleanhasLimit()

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Returns
Type Description
boolean

Whether the limit field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFilter(Filter value)

publicQuery.BuildermergeFilter(Filtervalue)

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Parameter
Name Description
value Filter
Returns
Type Description
Query.Builder

mergeFindNearest(FindNearest value)

publicQuery.BuildermergeFindNearest(FindNearestvalue)

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value FindNearest
Returns
Type Description
Query.Builder

mergeFrom(Query other)

publicQuery.BuildermergeFrom(Queryother)
Parameter
Name Description
other Query
Returns
Type Description
Query.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicQuery.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Query.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicQuery.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Query.Builder
Overrides

mergeLimit(Int32Value value)

publicQuery.BuildermergeLimit(Int32Valuevalue)

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Parameter
Name Description
value Int32Value
Returns
Type Description
Query.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalQuery.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Query.Builder
Overrides

removeDistinctOn(int index)

publicQuery.BuilderremoveDistinctOn(intindex)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameter
Name Description
index int
Returns
Type Description
Query.Builder

removeKind(int index)

publicQuery.BuilderremoveKind(intindex)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameter
Name Description
index int
Returns
Type Description
Query.Builder

removeOrder(int index)

publicQuery.BuilderremoveOrder(intindex)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameter
Name Description
index int
Returns
Type Description
Query.Builder

removeProjection(int index)

publicQuery.BuilderremoveProjection(intindex)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameter
Name Description
index int
Returns
Type Description
Query.Builder

setDistinctOn(int index, PropertyReference value)

publicQuery.BuildersetDistinctOn(intindex,PropertyReferencevalue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameters
Name Description
index int
value PropertyReference
Returns
Type Description
Query.Builder

setDistinctOn(int index, PropertyReference.Builder builderForValue)

publicQuery.BuildersetDistinctOn(intindex,PropertyReference.BuilderbuilderForValue)

The properties to make distinct. The query results will contain the first result for each distinct combination of values for the given properties (if empty, all results are returned).

Requires:

  • If order is specified, the set of distinct on properties must appear before the non-distinct on properties in order.

repeated .google.datastore.v1.PropertyReference distinct_on = 6;

Parameters
Name Description
index int
builderForValue PropertyReference.Builder
Returns
Type Description
Query.Builder

setEndCursor(ByteString value)

publicQuery.BuildersetEndCursor(ByteStringvalue)

An ending point for the query results. Query cursors are returned in query result batches and can only be used to limit the same query.

bytes end_cursor = 8;

Parameter
Name Description
value ByteString

The endCursor to set.

Returns
Type Description
Query.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicQuery.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Query.Builder
Overrides

setFilter(Filter value)

publicQuery.BuildersetFilter(Filtervalue)

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Parameter
Name Description
value Filter
Returns
Type Description
Query.Builder

setFilter(Filter.Builder builderForValue)

publicQuery.BuildersetFilter(Filter.BuilderbuilderForValue)

The filter to apply.

.google.datastore.v1.Filter filter = 4;

Parameter
Name Description
builderForValue Filter.Builder
Returns
Type Description
Query.Builder

setFindNearest(FindNearest value)

publicQuery.BuildersetFindNearest(FindNearestvalue)

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value FindNearest
Returns
Type Description
Query.Builder

setFindNearest(FindNearest.Builder builderForValue)

publicQuery.BuildersetFindNearest(FindNearest.BuilderbuilderForValue)

Optional. A potential Nearest Neighbors Search.

Applies after all other filters and ordering.

Finds the closest vector embeddings to the given query vector.

.google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue FindNearest.Builder
Returns
Type Description
Query.Builder

setKind(int index, KindExpression value)

publicQuery.BuildersetKind(intindex,KindExpressionvalue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameters
Name Description
index int
value KindExpression
Returns
Type Description
Query.Builder

setKind(int index, KindExpression.Builder builderForValue)

publicQuery.BuildersetKind(intindex,KindExpression.BuilderbuilderForValue)

The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be specified.

repeated .google.datastore.v1.KindExpression kind = 3;

Parameters
Name Description
index int
builderForValue KindExpression.Builder
Returns
Type Description
Query.Builder

setLimit(Int32Value value)

publicQuery.BuildersetLimit(Int32Valuevalue)

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Parameter
Name Description
value Int32Value
Returns
Type Description
Query.Builder

setLimit(Int32Value.Builder builderForValue)

publicQuery.BuildersetLimit(Int32Value.BuilderbuilderForValue)

The maximum number of results to return. Applies after all other constraints. Optional. Unspecified is interpreted as no limit. Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Query.Builder

setOffset(int value)

publicQuery.BuildersetOffset(intvalue)

The number of results to skip. Applies before limit, but after all other constraints. Optional. Must be >= 0 if specified.

int32 offset = 10;

Parameter
Name Description
value int

The offset to set.

Returns
Type Description
Query.Builder

This builder for chaining.

setOrder(int index, PropertyOrder value)

publicQuery.BuildersetOrder(intindex,PropertyOrdervalue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameters
Name Description
index int
value PropertyOrder
Returns
Type Description
Query.Builder

setOrder(int index, PropertyOrder.Builder builderForValue)

publicQuery.BuildersetOrder(intindex,PropertyOrder.BuilderbuilderForValue)

The order to apply to the query results (if empty, order is unspecified).

repeated .google.datastore.v1.PropertyOrder order = 5;

Parameters
Name Description
index int
builderForValue PropertyOrder.Builder
Returns
Type Description
Query.Builder

setProjection(int index, Projection value)

publicQuery.BuildersetProjection(intindex,Projectionvalue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameters
Name Description
index int
value Projection
Returns
Type Description
Query.Builder

setProjection(int index, Projection.Builder builderForValue)

publicQuery.BuildersetProjection(intindex,Projection.BuilderbuilderForValue)

The projection to return. Defaults to returning all properties.

repeated .google.datastore.v1.Projection projection = 2;

Parameters
Name Description
index int
builderForValue Projection.Builder
Returns
Type Description
Query.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicQuery.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Query.Builder
Overrides

setStartCursor(ByteString value)

publicQuery.BuildersetStartCursor(ByteStringvalue)

A starting point for the query results. Query cursors are returned in query result batches and can only be used to continue the same query.

bytes start_cursor = 7;

Parameter
Name Description
value ByteString

The startCursor to set.

Returns
Type Description
Query.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalQuery.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Query.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.