public static final class QueryEnhancedRequest.Builder extends Object
A valid builder must set the queryConditional
parameter. Other parameters are optional.
Modifier and Type | Method and Description |
---|---|
QueryEnhancedRequest.Builder |
addAttributeToProject(String attributeToProject)
Adds a single attribute name to be retrieved from the database.
|
QueryEnhancedRequest.Builder |
addNestedAttributesToProject(Collection<NestedAttributeName> nestedAttributeNames)
Adds a collection of the NestedAttributeNames to be retrieved from the database.
|
QueryEnhancedRequest.Builder |
addNestedAttributesToProject(NestedAttributeName... nestedAttributeNames)
Adds one or more attribute names to be retrieved from the database.
|
QueryEnhancedRequest.Builder |
addNestedAttributeToProject(NestedAttributeName nestedAttributeName)
Adds a single NestedAttributeName to be retrieved from the database.
|
QueryEnhancedRequest.Builder |
attributesToProject(Collection<String> attributesToProject)
Sets a collection of the attribute names to be retrieved from the database.
|
QueryEnhancedRequest.Builder |
attributesToProject(String... attributesToProject)
Sets one or more attribute names to be retrieved from the database.
|
QueryEnhancedRequest |
build() |
QueryEnhancedRequest.Builder |
consistentRead(Boolean consistentRead)
Determines the read consistency model: If set to true, the operation uses strongly consistent reads; otherwise,
the operation uses eventually consistent reads.
|
QueryEnhancedRequest.Builder |
exclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
The primary key of the first item that this operation will evaluate.
|
QueryEnhancedRequest.Builder |
filterExpression(Expression filterExpression)
Refines the query results by applying the filter expression on the results returned
from the query and discards items that do not match.
|
QueryEnhancedRequest.Builder |
limit(Integer limit)
Sets a limit on how many items to evaluate in the query.
|
QueryEnhancedRequest.Builder |
queryConditional(QueryConditional queryConditional)
Determines the matching conditions for this query request.
|
QueryEnhancedRequest.Builder |
scanIndexForward(Boolean scanIndexForward)
Results are sorted by sort key in ascending order if
scanIndexForward is true. |
public QueryEnhancedRequest.Builder queryConditional(QueryConditional queryConditional)
QueryConditional
for examples
and constraints. Required.queryConditional
- the query conditionspublic QueryEnhancedRequest.Builder scanIndexForward(Boolean scanIndexForward)
scanIndexForward
is true. If its false, the
order is descending. The default value is true.scanIndexForward
- the sort orderpublic QueryEnhancedRequest.Builder exclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
Page.lastEvaluatedKey()
in the previous operation.exclusiveStartKey
- the primary key value where DynamoDb should start to evaluate itemspublic QueryEnhancedRequest.Builder limit(Integer limit)
Note:The limit does not refer to the number of items to return, but how many items
the database should evaluate while executing the query. Use limit together with Page.lastEvaluatedKey()
and exclusiveStartKey
in subsequent query calls to evaluate limit items per call.
limit
- the maximum number of items to evalutepublic QueryEnhancedRequest.Builder consistentRead(Boolean consistentRead)
By default, the value of this property is set to false.
consistentRead
- sets consistency model of the operation to use strong consistencypublic QueryEnhancedRequest.Builder filterExpression(Expression filterExpression)
Expression
for examples
and constraints.
Note: Using the filter expression does not reduce the cost of the query, since it is applied after the database has found matching items.
filterExpression
- an expression that filters results of evaluating the querypublic QueryEnhancedRequest.Builder attributesToProject(Collection<String> attributesToProject)
Sets a collection of the attribute names to be retrieved from the database. These attributes can include scalars, sets, or elements of a JSON document.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result. If there are nested attributes then addNestedAttributesToProject API should be used.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
attributesToProject
- A collection of the attributes names to be retrieved from the database.public QueryEnhancedRequest.Builder attributesToProject(String... attributesToProject)
Sets one or more attribute names to be retrieved from the database. These attributes can include scalars, sets, or elements of a JSON document.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result. If there are nested attributes then addNestedAttributesToProject API should be used.
For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
attributesToProject
- One or more attributes names to be retrieved from the database.public QueryEnhancedRequest.Builder addAttributeToProject(String attributeToProject)
Adds a single attribute name to be retrieved from the database. This attribute can include scalars, sets, or elements of a JSON document. If there are nested attributes then addNestedAttributesToProject API should be used.
attributeToProject
- An additional single attribute name to be retrieved from the database.public QueryEnhancedRequest.Builder addNestedAttributesToProject(Collection<NestedAttributeName> nestedAttributeNames)
Adds a collection of the NestedAttributeNames to be retrieved from the database. These attributes can include scalars, sets, or elements of a JSON document. This method takes arguments in form of NestedAttributeName which supports representing nested attributes. The NestedAttributeNames is specially created for projecting Nested Attribute names. The DOT characters are not recognized as nesting separator by DDB thus for Enhanced request NestedAttributeNames should be created to project Nested Attribute name at various levels. This method will add new attributes to project to the existing list of attributes to project stored by this builder.
nestedAttributeNames
- A collection of the attributes names to be retrieved from the database.
Nested levels of Attributes can be added using NestedAttributeName class.
Refer NestedAttributeName
.public QueryEnhancedRequest.Builder addNestedAttributesToProject(NestedAttributeName... nestedAttributeNames)
Adds one or more attribute names to be retrieved from the database. These attributes can include scalars, sets, or elements of a JSON document. This method takes arguments in form of NestedAttributeName which supports representing nested attributes. This method takes arguments in form of NestedAttributeName which supports representing nested attributes. The NestedAttributeNames is specially created for projecting Nested Attribute names. The DOT characters are not recognized as nesting separator by DDB thus for Enhanced request NestedAttributeNames should be created to project Nested Attribute name at various levels. This method will add new attributes to project to the existing list of attributes to project stored by this builder.
nestedAttributeNames
- One or more attributesNames to be retrieved from the database.
Nested levels of Attributes can be added using NestedAttributeName class.
Refer NestedAttributeName
.public QueryEnhancedRequest.Builder addNestedAttributeToProject(NestedAttributeName nestedAttributeName)
Adds a single NestedAttributeName to be retrieved from the database. This attribute can include scalars, sets, or elements of a JSON document. This method takes arguments in form of NestedAttributeName which supports representing nested attributes. This method will add new attributes to project to the existing list of attributes to project stored by this builder.
nestedAttributeName
- An additional single attribute name to be retrieved from the database.
Refer NestedAttributeName
.public QueryEnhancedRequest build()
Copyright © 2021. All rights reserved.