Class DynamoDBQueryExpression<T>
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T>
-
public class DynamoDBQueryExpression<T> extends Object
A query expression.
-
-
Constructor Summary
Constructors Constructor Description DynamoDBQueryExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamoDBQueryExpression<T>
addExpressionAttributeNamesEntry(String key, String value)
One or more substitution variables for simplifying complex expressions.DynamoDBQueryExpression<T>
addExpressionAttributeValuesEntry(String key, AttributeValue value)
One or more values that can be substituted in an expression.DynamoDBQueryExpression<T>
clearExpressionAttributeNamesEntries()
Removes all the entries added into ExpressionAttributeNames.DynamoDBQueryExpression<T>
clearExpressionAttributeValuesEntries()
Removes all the entries added into ExpressionAttributeValues.String
getConditionalOperator()
Returns the logical operator on the query filter conditions.Map<String,AttributeValue>
getExclusiveStartKey()
Returns the exclusive start key for this query.Map<String,String>
getExpressionAttributeNames()
One or more substitution variables for simplifying complex expressions.Map<String,AttributeValue>
getExpressionAttributeValues()
One or more values that can be substituted in an expression.String
getFilterExpression()
Evaluates the query results and returns only the desired values.T
getHashKeyValues()
Gets the hash key value(s) for this query.String
getIndexName()
Returns the name of the index to be used by this query.String
getKeyConditionExpression()
Returns the condition that specifies the key value(s) for items to be retrieved by the Query action.Integer
getLimit()
Returns the maximum number of items to retrieve in each service request to DynamoDB.String
getProjectionExpression()
A string that identifies one or more attributes to retrieve from the table.Map<String,Condition>
getQueryFilter()
Returns the query filter applied on this query.Map<String,Condition>
getRangeKeyConditions()
Gets the range key condition for this query.String
getReturnConsumedCapacity()
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes.String
getSelect()
The attributes to be returned in the result.boolean
isConsistentRead()
Returns whether this query uses consistent reads.boolean
isScanIndexForward()
Returns whether this query scans forward.void
setConditionalOperator(ConditionalOperator conditionalOperator)
Sets the logical operator on the query filter conditions.void
setConditionalOperator(String conditionalOperator)
Sets the logical operator on the query filter conditions.void
setConsistentRead(boolean consistentRead)
Sets whether this query uses consistent reads.void
setExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query.void
setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.void
setExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.void
setFilterExpression(String filterExpression)
Evaluates the query results and returns only the desired values.void
setHashKeyValues(T hashKeyValues)
Sets the hash key value(s) for this query.void
setIndexName(String indexName)
Sets the name of the index to be used by this query.void
setKeyConditionExpression(String keyConditionExpression)
Sets the condition that specifies the key value(s) for items to be retrieved by the Query action.void
setLimit(Integer limit)
Sets the maximum number of items to retrieve in each service request to DynamoDB.void
setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table.void
setQueryFilter(Map<String,Condition> queryFilter)
Sets the query filter applied on this query.void
setRangeKeyConditions(Map<String,Condition> rangeKeyConditions)
Sets the range key condition for this query.void
setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes.void
setReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes.void
setScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward.void
setSelect(Select select)
The attributes to be returned in the result.void
setSelect(String select)
The attributes to be returned in the result.DynamoDBQueryExpression<T>
withConditionalOperator(ConditionalOperator conditionalOperator)
Sets the logical operator on the query filter conditions.DynamoDBQueryExpression<T>
withConditionalOperator(String conditionalOperator)
Sets the logical operator on the query filter conditions.DynamoDBQueryExpression<T>
withConsistentRead(boolean consistentRead)
Sets whether this query uses consistent reads and returns a pointer to this object for method-chaining.DynamoDBQueryExpression<T>
withExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query and returns a pointer to this object for method-chaining.DynamoDBQueryExpression<T>
withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.DynamoDBQueryExpression<T>
withExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.DynamoDBQueryExpression<T>
withFilterExpression(String filterExpression)
Evaluates the query results and returns only the desired values.DynamoDBQueryExpression<T>
withHashKeyValues(T hashKObject)
Sets the hash key value(s) for this query.DynamoDBQueryExpression<T>
withIndexName(String indexName)
Sets the name of the index to be used by this query.DynamoDBQueryExpression<T>
withKeyConditionExpression(String keyConditionExpression)
DynamoDBQueryExpression<T>
withLimit(Integer limit)
Sets the maximum number of items to retrieve in each service request to DynamoDB and returns a pointer to this object for method-chaining.DynamoDBQueryExpression<T>
withProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table.DynamoDBQueryExpression<T>
withQueryFilter(Map<String,Condition> queryFilter)
Sets the query filter applied on this query.DynamoDBQueryExpression<T>
withQueryFilterEntry(String attributeName, Condition condition)
Adds a new condition to the the query filter.DynamoDBQueryExpression<T>
withRangeKeyCondition(String rangeKeyAttributeName, Condition rangeKeyCondition)
Sets one range key condition for this query, using the attribute name of the range key.DynamoDBQueryExpression<T>
withRangeKeyConditions(Map<String,Condition> rangeKeyConditions)
Sets the range key condition for this query.DynamoDBQueryExpression<T>
withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes.DynamoDBQueryExpression<T>
withReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes.DynamoDBQueryExpression<T>
withScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward and returns a pointer to this object for method-chaining.DynamoDBQueryExpression<T>
withSelect(Select select)
The attributes to be returned in the result.DynamoDBQueryExpression<T>
withSelect(String select)
The attributes to be returned in the result.
-
-
-
Method Detail
-
isConsistentRead
public boolean isConsistentRead()
Returns whether this query uses consistent reads.
-
setConsistentRead
public void setConsistentRead(boolean consistentRead)
Sets whether this query uses consistent reads.
-
withConsistentRead
public DynamoDBQueryExpression<T> withConsistentRead(boolean consistentRead)
Sets whether this query uses consistent reads and returns a pointer to this object for method-chaining.
-
isScanIndexForward
public boolean isScanIndexForward()
Returns whether this query scans forward.
-
setScanIndexForward
public void setScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward.
-
withScanIndexForward
public DynamoDBQueryExpression<T> withScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward and returns a pointer to this object for method-chaining.
-
getExclusiveStartKey
public Map<String,AttributeValue> getExclusiveStartKey()
Returns the exclusive start key for this query.
-
setExclusiveStartKey
public void setExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query.
-
withExclusiveStartKey
public DynamoDBQueryExpression<T> withExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query and returns a pointer to this object for method-chaining.
-
getLimit
public Integer getLimit()
Returns the maximum number of items to retrieve in each service request to DynamoDB.Note that when calling
DynamoDBMapper.query
, multiple requests are made to DynamoDB if needed to retrieve the entire result set. Setting this will limit the number of items retrieved by each request, NOT the total number of results that will be retrieved. UseDynamoDBMapper.queryPage
to retrieve a single page of items from DynamoDB.
-
setLimit
public void setLimit(Integer limit)
Sets the maximum number of items to retrieve in each service request to DynamoDB.Note that when calling
DynamoDBMapper.query
, multiple requests are made to DynamoDB if needed to retrieve the entire result set. Setting this will limit the number of items retrieved by each request, NOT the total number of results that will be retrieved. UseDynamoDBMapper.queryPage
to retrieve a single page of items from DynamoDB.
-
withLimit
public DynamoDBQueryExpression<T> withLimit(Integer limit)
Sets the maximum number of items to retrieve in each service request to DynamoDB and returns a pointer to this object for method-chaining.Note that when calling
DynamoDBMapper.query
, multiple requests are made to DynamoDB if needed to retrieve the entire result set. Setting this will limit the number of items retrieved by each request, NOT the total number of results that will be retrieved. UseDynamoDBMapper.queryPage
to retrieve a single page of items from DynamoDB.
-
getHashKeyValues
public T getHashKeyValues()
Gets the hash key value(s) for this query. All hash key attributes for the table must be specified with this key object.
-
setHashKeyValues
public void setHashKeyValues(T hashKeyValues)
Sets the hash key value(s) for this query. All hash key attributes for the table must be specified with this key object. Note 1: Currently the DynamoDBMapper supports only one value per hash key. Note 2: Currently the Amazon DynamoDB supports only one hash key per table/index.
-
withHashKeyValues
public DynamoDBQueryExpression<T> withHashKeyValues(T hashKObject)
Sets the hash key value(s) for this query. All hash key attributes for the table must be specified with this key object.
-
getRangeKeyConditions
public Map<String,Condition> getRangeKeyConditions()
Gets the range key condition for this query. All range key attributes for the table must be specified by attribute name in the map.
-
setRangeKeyConditions
public void setRangeKeyConditions(Map<String,Condition> rangeKeyConditions)
Sets the range key condition for this query. All range key attributes for the table must be specified by attribute name in the map.- Parameters:
rangeKeyConditions
- a map from key name to condition NOTE: The current DynamoDB service only allows up to one range key condition per query. Providing more than one range key condition will result in an AmazonClientException.
-
withRangeKeyConditions
public DynamoDBQueryExpression<T> withRangeKeyConditions(Map<String,Condition> rangeKeyConditions)
Sets the range key condition for this query. All range key attributes for the table must be specified by attribute name in the map.- Parameters:
rangeKeyConditions
- a map from key name to condition NOTE: The current DynamoDB service only allows up to one range key condition per query. Providing more than one range key condition will result in an AmazonClientException.
-
withRangeKeyCondition
public DynamoDBQueryExpression<T> withRangeKeyCondition(String rangeKeyAttributeName, Condition rangeKeyCondition)
Sets one range key condition for this query, using the attribute name of the range key. All range key attributes for the table must be specified by usingDynamoDBRangeKey
orDynamoDBIndexRangeKey
annotations before executing the query.- If the attribute is the primary range key
- users should NOT set any index name for this query.
- If the attribute is an index range key
-
DynamoDBMapper
will automatically set the index name if the range key is annotated as only used by one local secondary index, otherwise users must set the index name manually by eithersetIndexName(String)
orwithIndexName(String)
.
- Parameters:
rangeKeyAttributeName
- This can be either the primary range key of the table or an index range key.rangeKeyCondition
- Condition specified on the given range key for this query.
-
getIndexName
public String getIndexName()
Returns the name of the index to be used by this query.
-
setIndexName
public void setIndexName(String indexName)
Sets the name of the index to be used by this query. The hash key and/or range key of the index must be specified by addingDynamoDBIndexHashKey
orDynamoDBIndexRangeKey
annotations to the appropriate getter methods of the mapped object.
-
withIndexName
public DynamoDBQueryExpression<T> withIndexName(String indexName)
Sets the name of the index to be used by this query. The hash key and/or range key of the index must be specified by addingDynamoDBIndexHashKey
orDynamoDBIndexRangeKey
annotations to the appropriate getter methods of the mapped object.Returns a pointer to this object for method-chaining.
-
getQueryFilter
public Map<String,Condition> getQueryFilter()
Returns the query filter applied on this query.
-
setQueryFilter
public void setQueryFilter(Map<String,Condition> queryFilter)
Sets the query filter applied on this query.
-
withQueryFilter
public DynamoDBQueryExpression<T> withQueryFilter(Map<String,Condition> queryFilter)
Sets the query filter applied on this query.Returns a pointer to this object for method-chaining.
-
withQueryFilterEntry
public DynamoDBQueryExpression<T> withQueryFilterEntry(String attributeName, Condition condition)
Adds a new condition to the the query filter.Returns a pointer to this object for method-chaining.
- Parameters:
attributeName
- The name of the attribute on which the specified condition operates.condition
- The filter condition applied on the attribute.
-
getConditionalOperator
public String getConditionalOperator()
Returns the logical operator on the query filter conditions.
-
setConditionalOperator
public void setConditionalOperator(String conditionalOperator)
Sets the logical operator on the query filter conditions.
-
withConditionalOperator
public DynamoDBQueryExpression<T> withConditionalOperator(String conditionalOperator)
Sets the logical operator on the query filter conditions.Returns a pointer to this object for method-chaining.
-
setConditionalOperator
public void setConditionalOperator(ConditionalOperator conditionalOperator)
Sets the logical operator on the query filter conditions.
-
withConditionalOperator
public DynamoDBQueryExpression<T> withConditionalOperator(ConditionalOperator conditionalOperator)
Sets the logical operator on the query filter conditions.Returns a pointer to this object for method-chaining.
-
getFilterExpression
public String getFilterExpression()
Evaluates the query results and returns only the desired values.The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
- Returns:
- Evaluates the query results and returns only the desired values.
The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
- See Also:
QueryRequest.getFilterExpression()
-
setFilterExpression
public void setFilterExpression(String filterExpression)
Evaluates the query results and returns only the desired values.The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
- Parameters:
filterExpression
- Evaluates the query results and returns only the desired values.The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
- See Also:
QueryRequest.setFilterExpression(String)
-
withFilterExpression
public DynamoDBQueryExpression<T> withFilterExpression(String filterExpression)
Evaluates the query results and returns only the desired values.The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
Returns a reference to this object so that method calls can be chained together.
- Parameters:
filterExpression
- Evaluates the query results and returns only the desired values.The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
QueryRequest.withFilterExpression(String)
-
getKeyConditionExpression
public String getKeyConditionExpression()
Returns the condition that specifies the key value(s) for items to be retrieved by the Query action.The condition must perform an equality test on a single hash key value. The condition can also test for one or more range key values. A Query can use KeyConditionExpression to retrieve a single item with a given hash and range key value, or several items that have the same hash key value but different range key values.
The hash key equality test is required, and must be specified in the following format:
hashAttributeName
=:hashval
If you also want to provide a range key condition, it must be combined using AND with the hash key condition. Following is an example, using the = comparison operator for the range key:
hashAttributeName
=:hashval
ANDrangeAttributeName
=:rangeval
Valid comparisons for the range key condition are as follows:
-
rangeAttributeName
=:rangeval
- true if the range key is equal to:rangeval
. -
rangeAttributeName
<:rangeval
- true if the range key is less than:rangeval
. -
rangeAttributeName
<=:rangeval
- true if the range key is less than or equal to:rangeval
. -
rangeAttributeName
>:rangeval
- true if the range key is greater than:rangeval
. -
rangeAttributeName
>=:rangeval
- true if the range key is greater than or equal to:rangeval
. -
rangeAttributeName
BETWEEN:rangeval1
AND:rangeval2
- true if the range key is less than or greater than:rangeval1
, and less than or equal to:rangeval2
. -
begins_with (
rangeAttributeName
,:rangeval
) - true if the range key begins with a particular operand. Note that the function namebegins_with
is case-sensitive.
Use ExpressionAttributeValues (via
withExpressionAttributeValues(Map)
) to replace tokens such as:hashval
and:rangeval
with actual values at runtime.You can optionally use ExpressionAttributeNames (via
withExpressionAttributeNames(Map)
) to replace the names of the hash and range attributes with placeholder tokens. This might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression causes an error because Size is a reserved word:-
Size = :myval
To work around this, define a placeholder (such a
#myval
) to represent the attribute name Size. KeyConditionExpression then is as follows:-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames and ExpressionAttributeValues, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
KeyConditionExpression replaces the legacy KeyConditions parameter.
- Returns:
- The condition that specifies the key value(s) for items to be
retrieved by the Query action.
The condition must perform an equality test on a single hash key value. The condition can also test for one or more range key values. A Query can use KeyConditionExpression to retrieve a single item with a given hash and range key value, or several items that have the same hash key value but different range key values.
The hash key equality test is required, and must be specified in the following format:
hashAttributeName
=:hashval
If you also want to provide a range key condition, it must be combined using AND with the hash key condition. Following is an example, using the = comparison operator for the range key:
hashAttributeName
=:hashval
ANDrangeAttributeName
=:rangeval
Valid comparisons for the range key condition are as follows:
-
rangeAttributeName
=:rangeval
- true if the range key is equal to:rangeval
. -
rangeAttributeName
<:rangeval
- true if the range key is less than:rangeval
. -
rangeAttributeName
<=:rangeval
- true if the range key is less than or equal to:rangeval
. -
rangeAttributeName
>:rangeval
- true if the range key is greater than:rangeval
. -
rangeAttributeName
>=:rangeval
- true if the range key is greater than or equal to:rangeval
. -
rangeAttributeName
BETWEEN:rangeval1
AND:rangeval2
- true if the range key is less than or greater than:rangeval1
, and less than or equal to:rangeval2
. -
begins_with (
rangeAttributeName
,:rangeval
) - true if the range key begins with a particular operand. Note that the function namebegins_with
is case-sensitive.
Use ExpressionAttributeValues (via
withExpressionAttributeValues(Map)
) to replace tokens such as:hashval
and:rangeval
with actual values at runtime.You can optionally use ExpressionAttributeNames (via
withExpressionAttributeNames(Map)
) to replace the names of the hash and range attributes with placeholder tokens. This might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression causes an error because Size is a reserved word:-
Size = :myval
To work around this, define a placeholder (such a
#myval
) to represent the attribute name Size. KeyConditionExpression then is as follows:-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames and ExpressionAttributeValues, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
KeyConditionExpression replaces the legacy KeyConditions parameter.
-
-
-
setKeyConditionExpression
public void setKeyConditionExpression(String keyConditionExpression)
Sets the condition that specifies the key value(s) for items to be retrieved by the Query action.The condition must perform an equality test on a single hash key value. The condition can also test for one or more range key values. A Query can use KeyConditionExpression to retrieve a single item with a given hash and range key value, or several items that have the same hash key value but different range key values.
The hash key equality test is required, and must be specified in the following format:
hashAttributeName
=:hashval
If you also want to provide a range key condition, it must be combined using AND with the hash key condition. Following is an example, using the = comparison operator for the range key:
hashAttributeName
=:hashval
ANDrangeAttributeName
=:rangeval
Valid comparisons for the range key condition are as follows:
-
rangeAttributeName
=:rangeval
- true if the range key is equal to:rangeval
. -
rangeAttributeName
<:rangeval
- true if the range key is less than:rangeval
. -
rangeAttributeName
<=:rangeval
- true if the range key is less than or equal to:rangeval
. -
rangeAttributeName
>:rangeval
- true if the range key is greater than:rangeval
. -
rangeAttributeName
>=:rangeval
- true if the range key is greater than or equal to:rangeval
. -
rangeAttributeName
BETWEEN:rangeval1
AND:rangeval2
- true if the range key is less than or greater than:rangeval1
, and less than or equal to:rangeval2
. -
begins_with (
rangeAttributeName
,:rangeval
) - true if the range key begins with a particular operand. Note that the function namebegins_with
is case-sensitive.
Use ExpressionAttributeValues (via
withExpressionAttributeValues(Map)
) to replace tokens such as:hashval
and:rangeval
with actual values at runtime.You can optionally use ExpressionAttributeNames via
withExpressionAttributeNames(Map)
) to replace the names of the hash and range attributes with placeholder tokens. This might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following KeyConditionExpression causes an error because Size is a reserved word:-
Size = :myval
To work around this, define a placeholder (such a
#myval
) to represent the attribute name Size. KeyConditionExpression then is as follows:-
#S = :myval
For a list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide.
For more information on ExpressionAttributeNames and ExpressionAttributeValues, see Using Placeholders for Attribute Names and Values in the Amazon DynamoDB Developer Guide.
KeyConditionExpression replaces the legacy KeyConditions parameter.
When a key expression is specified, the corresponding name-map and value-map can optionally be specified via
withExpressionAttributeNames(Map)
andwithExpressionAttributeValues(Map)
. -
-
withKeyConditionExpression
public DynamoDBQueryExpression<T> withKeyConditionExpression(String keyConditionExpression)
-
getExpressionAttributeNames
public Map<String,String> getExpressionAttributeNames()
One or more substitution variables for simplifying complex expressions.- Returns:
- One or more substitution variables for simplifying complex expressions.
- See Also:
QueryRequest.getExpressionAttributeNames()
-
setExpressionAttributeNames
public void setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.- Parameters:
expressionAttributeNames
- One or more substitution variables for simplifying complex expressions.- See Also:
QueryRequest.setExpressionAttributeNames(Map)
-
withExpressionAttributeNames
public DynamoDBQueryExpression<T> withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.- Parameters:
expressionAttributeNames
- One or more substitution variables for simplifying complex expressions.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
QueryRequest.withExpressionAttributeNames(Map)
-
addExpressionAttributeNamesEntry
public DynamoDBQueryExpression<T> addExpressionAttributeNamesEntry(String key, String value)
One or more substitution variables for simplifying complex expressions. The method adds a new key-value pair into ExpressionAttributeNames parameter, and returns a reference to this object so that method calls can be chained together.- Parameters:
key
- The key of the entry to be added into ExpressionAttributeNames.value
- The corresponding value of the entry to be added into ExpressionAttributeNames.- See Also:
QueryRequest.addExpressionAttributeNamesEntry(String, String)
-
clearExpressionAttributeNamesEntries
public DynamoDBQueryExpression<T> clearExpressionAttributeNamesEntries()
Removes all the entries added into ExpressionAttributeNames.Returns a reference to this object so that method calls can be chained together.
-
getExpressionAttributeValues
public Map<String,AttributeValue> getExpressionAttributeValues()
One or more values that can be substituted in an expression.- Returns:
- One or more values that can be substituted in an expression.
- See Also:
QueryRequest.getExpressionAttributeValues()
-
setExpressionAttributeValues
public void setExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.- Parameters:
expressionAttributeValues
- One or more values that can be substituted in an expression.- See Also:
QueryRequest.setExpressionAttributeValues(Map)
-
withExpressionAttributeValues
public DynamoDBQueryExpression<T> withExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.- Parameters:
expressionAttributeValues
- One or more values that can be substituted in an expression.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
QueryRequest.withExpressionAttributeValues(Map)
-
addExpressionAttributeValuesEntry
public DynamoDBQueryExpression<T> addExpressionAttributeValuesEntry(String key, AttributeValue value)
One or more values that can be substituted in an expression. The method adds a new key-value pair into ExpressionAttributeValues parameter, and returns a reference to this object so that method calls can be chained together.- Parameters:
key
- The key of the entry to be added into ExpressionAttributeValues.value
- The corresponding value of the entry to be added into ExpressionAttributeValues.- See Also:
QueryRequest.addExpressionAttributeValuesEntry(String, AttributeValue)
-
clearExpressionAttributeValuesEntries
public DynamoDBQueryExpression<T> clearExpressionAttributeValuesEntries()
Removes all the entries added into ExpressionAttributeValues.Returns a reference to this object so that method calls can be chained together.
-
getSelect
public String getSelect()
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT- Returns:
- The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.
- See Also:
Select
-
setSelect
public void setSelect(String select)
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT- Parameters:
select
- The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.- See Also:
Select
-
withSelect
public DynamoDBQueryExpression<T> withSelect(String select)
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT- Parameters:
select
- The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
Select
-
setSelect
public void setSelect(Select select)
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT- Parameters:
select
- The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.- See Also:
Select
-
withSelect
public DynamoDBQueryExpression<T> withSelect(Select select)
The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT- Parameters:
select
- The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
Select
-
getProjectionExpression
public String getProjectionExpression()
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
- Returns:
- A string that identifies one or more attributes to retrieve from the
table. These attributes can include scalars, sets, or elements of a
JSON document. The attributes in the expression must be separated by
commas.
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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
-
setProjectionExpression
public void setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
- Parameters:
projectionExpression
- A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
-
withProjectionExpression
public DynamoDBQueryExpression<T> withProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
Returns a reference to this object so that method calls can be chained together.
- Parameters:
projectionExpression
- A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.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.
For more information, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
- Returns:
- A reference to this updated object so that method calls can be chained together.
-
getReturnConsumedCapacity
public String getReturnConsumedCapacity()
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.Constraints:
Allowed Values: INDEXES, TOTAL, NONEIf enabled, the underlying request to DynamoDB will include the configured parameter value and the low-level response from DynamoDB will include the amount of capacity consumed by the query. Currently, the consumed capacity is only exposed through the DynamoDBMapper when you call
DynamoDBMapper.queryPage
, notDynamoDBMapper.query
.- Returns:
- A value that if set to
TOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response. - See Also:
ReturnConsumedCapacity
-
setReturnConsumedCapacity
public void setReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.Constraints:
Allowed Values: INDEXES, TOTAL, NONEIf enabled, the underlying request to DynamoDB will include the configured parameter value and the low-level response from DynamoDB will include the amount of capacity consumed by the query. Currently, the consumed capacity is only exposed through the DynamoDBMapper when you call
DynamoDBMapper.queryPage
, notDynamoDBMapper.query
.- Parameters:
returnConsumedCapacity
- A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.- See Also:
ReturnConsumedCapacity
-
withReturnConsumedCapacity
public DynamoDBQueryExpression<T> withReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONEIf enabled, the underlying request to DynamoDB will include the configured parameter value and the low-level response from DynamoDB will include the amount of capacity consumed by the query. Currently, the consumed capacity is only exposed through the DynamoDBMapper when you call
DynamoDBMapper.queryPage
, notDynamoDBMapper.query
.- Parameters:
returnConsumedCapacity
- A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
ReturnConsumedCapacity
-
setReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.Constraints:
Allowed Values: INDEXES, TOTAL, NONEIf enabled, the underlying request to DynamoDB will include the configured parameter value and the low-level response from DynamoDB will include the amount of capacity consumed by the query. Currently, the consumed capacity is only exposed through the DynamoDBMapper when you call
DynamoDBMapper.queryPage
, notDynamoDBMapper.query
.- Parameters:
returnConsumedCapacity
- A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.- See Also:
ReturnConsumedCapacity
-
withReturnConsumedCapacity
public DynamoDBQueryExpression<T> withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONEIf enabled, the underlying request to DynamoDB will include the configured parameter value and the low-level response from DynamoDB will include the amount of capacity consumed by the query. Currently, the consumed capacity is only exposed through the DynamoDBMapper when you call
DynamoDBMapper.queryPage
, notDynamoDBMapper.query
.- Parameters:
returnConsumedCapacity
- A value that if set toTOTAL
, the response includes ConsumedCapacity data for tables and indexes. If set toINDEXES
, the response includes ConsumedCapacity for indexes. If set toNONE
(the default), ConsumedCapacity is not included in the response.- Returns:
- A reference to this updated object so that method calls can be chained together.
- See Also:
ReturnConsumedCapacity
-
-