public class DynamoDBQueryExpression<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
conditionalOperator |
private boolean |
consistentRead |
private java.util.Map<java.lang.String,AttributeValue> |
exclusiveStartKey |
private java.util.Map<java.lang.String,java.lang.String> |
expressionAttributeNames
One or more substitution variables for simplifying complex expressions.
|
private java.util.Map<java.lang.String,AttributeValue> |
expressionAttributeValues
One or more values that can be substituted in an expression.
|
private java.lang.String |
filterExpression
Evaluates the query results and returns only the desired values.
|
private T |
hashKeyValues |
private java.lang.String |
indexName |
private java.lang.String |
keyConditionExpression
The condition that specifies the key value(s) for items to be retrieved
by the Query action.
|
private java.lang.Integer |
limit |
private java.lang.String |
projectionExpression
A string that identifies one or more attributes to retrieve from the
table.
|
private java.util.Map<java.lang.String,Condition> |
queryFilter |
private java.util.Map<java.lang.String,Condition> |
rangeKeyConditions |
private java.lang.String |
returnConsumedCapacity
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
private boolean |
scanIndexForward |
private java.lang.String |
select
The attributes to be returned in the result.
|
Constructor and Description |
---|
DynamoDBQueryExpression() |
Modifier and Type | Method and Description |
---|---|
DynamoDBQueryExpression<T> |
addExpressionAttributeNamesEntry(java.lang.String key,
java.lang.String value)
One or more substitution variables for simplifying complex expressions.
|
DynamoDBQueryExpression<T> |
addExpressionAttributeValuesEntry(java.lang.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.
|
java.lang.String |
getConditionalOperator()
Returns the logical operator on the query filter conditions.
|
java.util.Map<java.lang.String,AttributeValue> |
getExclusiveStartKey()
Returns the exclusive start key for this query.
|
java.util.Map<java.lang.String,java.lang.String> |
getExpressionAttributeNames()
One or more substitution variables for simplifying complex expressions.
|
java.util.Map<java.lang.String,AttributeValue> |
getExpressionAttributeValues()
One or more values that can be substituted in an expression.
|
java.lang.String |
getFilterExpression()
Evaluates the query results and returns only the desired values.
|
T |
getHashKeyValues()
Gets the hash key value(s) for this query.
|
java.lang.String |
getIndexName()
Returns the name of the index to be used by this query.
|
java.lang.String |
getKeyConditionExpression()
Returns the condition that specifies the key value(s) for items to be
retrieved by the Query action.
|
java.lang.Integer |
getLimit()
Returns the maximum number of items to retrieve in each service request
to DynamoDB.
|
java.lang.String |
getProjectionExpression()
A string that identifies one or more attributes to retrieve from the
table.
|
java.util.Map<java.lang.String,Condition> |
getQueryFilter()
Returns the query filter applied on this query.
|
java.util.Map<java.lang.String,Condition> |
getRangeKeyConditions()
Gets the range key condition for this query.
|
java.lang.String |
getReturnConsumedCapacity()
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
java.lang.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(java.lang.String conditionalOperator)
Sets the logical operator on the query filter conditions.
|
void |
setConsistentRead(boolean consistentRead)
Sets whether this query uses consistent reads.
|
void |
setExclusiveStartKey(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query.
|
void |
setExpressionAttributeNames(java.util.Map<java.lang.String,java.lang.String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.
|
void |
setExpressionAttributeValues(java.util.Map<java.lang.String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.
|
void |
setFilterExpression(java.lang.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(java.lang.String indexName)
Sets the name of the index to be used by this query.
|
void |
setKeyConditionExpression(java.lang.String keyConditionExpression)
Sets the condition that specifies the key value(s) for items to be
retrieved by the Query action.
|
void |
setLimit(java.lang.Integer limit)
Sets the maximum number of items to retrieve in each service request to
DynamoDB.
|
void |
setProjectionExpression(java.lang.String projectionExpression)
A string that identifies one or more attributes to retrieve from the
table.
|
void |
setQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
Sets the query filter applied on this query.
|
void |
setRangeKeyConditions(java.util.Map<java.lang.String,Condition> rangeKeyConditions)
Sets the range key condition for this query.
|
void |
setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
void |
setReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
A value that if set to
TOTAL , 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(java.lang.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(java.lang.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(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
Sets the exclusive start key for this query and returns a pointer to this
object for method-chaining.
|
DynamoDBQueryExpression<T> |
withExpressionAttributeNames(java.util.Map<java.lang.String,java.lang.String> expressionAttributeNames)
One or more substitution variables for simplifying complex expressions.
|
DynamoDBQueryExpression<T> |
withExpressionAttributeValues(java.util.Map<java.lang.String,AttributeValue> expressionAttributeValues)
One or more values that can be substituted in an expression.
|
DynamoDBQueryExpression<T> |
withFilterExpression(java.lang.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(java.lang.String indexName)
Sets the name of the index to be used by this query.
|
DynamoDBQueryExpression<T> |
withKeyConditionExpression(java.lang.String keyConditionExpression) |
DynamoDBQueryExpression<T> |
withLimit(java.lang.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(java.lang.String projectionExpression)
A string that identifies one or more attributes to retrieve from the
table.
|
DynamoDBQueryExpression<T> |
withQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
Sets the query filter applied on this query.
|
DynamoDBQueryExpression<T> |
withQueryFilterEntry(java.lang.String attributeName,
Condition condition)
Adds a new condition to the the query filter.
|
DynamoDBQueryExpression<T> |
withRangeKeyCondition(java.lang.String rangeKeyAttributeName,
Condition rangeKeyCondition)
Sets one range key condition for this query, using the attribute name of
the range key.
|
DynamoDBQueryExpression<T> |
withRangeKeyConditions(java.util.Map<java.lang.String,Condition> rangeKeyConditions)
Sets the range key condition for this query.
|
DynamoDBQueryExpression<T> |
withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
DynamoDBQueryExpression<T> |
withReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
A value that if set to
TOTAL , 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(java.lang.String select)
The attributes to be returned in the result.
|
private boolean consistentRead
private boolean scanIndexForward
private T hashKeyValues
private java.util.Map<java.lang.String,Condition> rangeKeyConditions
private java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey
private java.lang.Integer limit
private java.lang.String indexName
private java.util.Map<java.lang.String,Condition> queryFilter
private java.lang.String conditionalOperator
private java.lang.String filterExpression
The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
private java.lang.String keyConditionExpression
private java.util.Map<java.lang.String,java.lang.String> expressionAttributeNames
private java.util.Map<java.lang.String,AttributeValue> expressionAttributeValues
private java.lang.String select
ALL_ATTRIBUTES
- Returns all of
the item attributes from the specified table or index. If you query a
local secondary index, then for each matching item in the index
DynamoDB will fetch the entire item from the parent table. If the
index is configured to project all item attributes, then all of the
data can be obtained from the local secondary index, and no fetching
is required.
ALL_PROJECTED_ATTRIBUTES
-
Allowed only when querying an index. Retrieves all attributes that
have been projected into the index. If the index is configured to
project all attributes, this return value is equivalent to specifying
ALL_ATTRIBUTES
.
COUNT
-
Returns the number of matching items, rather than the matching items
themselves.
SPECIFIC_ATTRIBUTES
- Returns
only the attributes listed in AttributesToGet. This return
value is equivalent to specifying AttributesToGet without
specifying any value for Select.
If you query a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB will fetch each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.
If you query a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.
If neither Select nor AttributesToGet are
specified, DynamoDB defaults to ALL_ATTRIBUTES
when
accessing a table, and ALL_PROJECTED_ATTRIBUTES
when
accessing an index. You cannot use both Select and
AttributesToGet together in a single request, unless the value
for Select is SPECIFIC_ATTRIBUTES
. (This usage is
equivalent to specifying AttributesToGet without any value for
Select.)
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT
private java.lang.String projectionExpression
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.
private java.lang.String returnConsumedCapacity
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
If 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
, not DynamoDBMapper.query
.
public boolean isConsistentRead()
public void setConsistentRead(boolean consistentRead)
public DynamoDBQueryExpression<T> withConsistentRead(boolean consistentRead)
public boolean isScanIndexForward()
public void setScanIndexForward(boolean scanIndexForward)
public DynamoDBQueryExpression<T> withScanIndexForward(boolean scanIndexForward)
public java.util.Map<java.lang.String,AttributeValue> getExclusiveStartKey()
public void setExclusiveStartKey(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
public DynamoDBQueryExpression<T> withExclusiveStartKey(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
public java.lang.Integer getLimit()
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. Use
DynamoDBMapper.queryPage
to retrieve a single page of items from
DynamoDB.
public void setLimit(java.lang.Integer limit)
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. Use
DynamoDBMapper.queryPage
to retrieve a single page of items from
DynamoDB.
public DynamoDBQueryExpression<T> withLimit(java.lang.Integer limit)
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. Use
DynamoDBMapper.queryPage
to retrieve a single page of items from
DynamoDB.
public T getHashKeyValues()
public void setHashKeyValues(T hashKeyValues)
public DynamoDBQueryExpression<T> withHashKeyValues(T hashKObject)
public java.util.Map<java.lang.String,Condition> getRangeKeyConditions()
public void setRangeKeyConditions(java.util.Map<java.lang.String,Condition> rangeKeyConditions)
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.public DynamoDBQueryExpression<T> withRangeKeyConditions(java.util.Map<java.lang.String,Condition> rangeKeyConditions)
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.public DynamoDBQueryExpression<T> withRangeKeyCondition(java.lang.String rangeKeyAttributeName, Condition rangeKeyCondition)
DynamoDBRangeKey
or DynamoDBIndexRangeKey
annotations
before executing the query.
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 either
setIndexName(String)
or
withIndexName(String)
.
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.public java.lang.String getIndexName()
public void setIndexName(java.lang.String indexName)
DynamoDBIndexHashKey
or DynamoDBIndexRangeKey
annotations to the appropriate getter methods of the mapped
object.public DynamoDBQueryExpression<T> withIndexName(java.lang.String indexName)
DynamoDBIndexHashKey
or DynamoDBIndexRangeKey
annotations to the appropriate getter methods of the mapped
object.
Returns a pointer to this object for method-chaining.
public java.util.Map<java.lang.String,Condition> getQueryFilter()
public void setQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
public DynamoDBQueryExpression<T> withQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
Returns a pointer to this object for method-chaining.
public DynamoDBQueryExpression<T> withQueryFilterEntry(java.lang.String attributeName, Condition condition)
Returns a pointer to this object for method-chaining.
attributeName
- The name of the attribute on which the specified condition
operates.condition
- The filter condition applied on the attribute.public java.lang.String getConditionalOperator()
public void setConditionalOperator(java.lang.String conditionalOperator)
public DynamoDBQueryExpression<T> withConditionalOperator(java.lang.String conditionalOperator)
Returns a pointer to this object for method-chaining.
public void setConditionalOperator(ConditionalOperator conditionalOperator)
public DynamoDBQueryExpression<T> withConditionalOperator(ConditionalOperator conditionalOperator)
Returns a pointer to this object for method-chaining.
public java.lang.String getFilterExpression()
The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
QueryRequest.getFilterExpression()
public void setFilterExpression(java.lang.String filterExpression)
The condition you specify is applied to the items queried; any items that do not match the expression are not returned.
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.
QueryRequest.setFilterExpression(String)
public DynamoDBQueryExpression<T> withFilterExpression(java.lang.String filterExpression)
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.
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.
QueryRequest.withFilterExpression(String)
public java.lang.String getKeyConditionExpression()
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
AND
rangeAttributeName
= :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 name begins_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.
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
AND rangeAttributeName
=
: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 name
begins_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.
public void setKeyConditionExpression(java.lang.String keyConditionExpression)
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
AND
rangeAttributeName
= :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 name begins_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)
and
withExpressionAttributeValues(Map)
.
public DynamoDBQueryExpression<T> withKeyConditionExpression(java.lang.String keyConditionExpression)
public java.util.Map<java.lang.String,java.lang.String> getExpressionAttributeNames()
QueryRequest.getExpressionAttributeNames()
public void setExpressionAttributeNames(java.util.Map<java.lang.String,java.lang.String> expressionAttributeNames)
expressionAttributeNames
- One or more substitution variables for simplifying complex
expressions.QueryRequest.setExpressionAttributeNames(Map)
public DynamoDBQueryExpression<T> withExpressionAttributeNames(java.util.Map<java.lang.String,java.lang.String> expressionAttributeNames)
expressionAttributeNames
- One or more substitution variables for simplifying complex
expressions.QueryRequest.withExpressionAttributeNames(Map)
public DynamoDBQueryExpression<T> addExpressionAttributeNamesEntry(java.lang.String key, java.lang.String value)
key
- The key of the entry to be added into
ExpressionAttributeNames.value
- The corresponding value of the entry to be added into
ExpressionAttributeNames.QueryRequest.addExpressionAttributeNamesEntry(String, String)
public DynamoDBQueryExpression<T> clearExpressionAttributeNamesEntries()
Returns a reference to this object so that method calls can be chained together.
public java.util.Map<java.lang.String,AttributeValue> getExpressionAttributeValues()
QueryRequest.getExpressionAttributeValues()
public void setExpressionAttributeValues(java.util.Map<java.lang.String,AttributeValue> expressionAttributeValues)
expressionAttributeValues
- One or more values that can be substituted in an expression.QueryRequest.setExpressionAttributeValues(Map)
public DynamoDBQueryExpression<T> withExpressionAttributeValues(java.util.Map<java.lang.String,AttributeValue> expressionAttributeValues)
expressionAttributeValues
- One or more values that can be substituted in an expression.QueryRequest.withExpressionAttributeValues(Map)
public DynamoDBQueryExpression<T> addExpressionAttributeValuesEntry(java.lang.String key, AttributeValue value)
key
- The key of the entry to be added into
ExpressionAttributeValues.value
- The corresponding value of the entry to be added into
ExpressionAttributeValues.QueryRequest.addExpressionAttributeValuesEntry(String,
AttributeValue)
public DynamoDBQueryExpression<T> clearExpressionAttributeValuesEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String getSelect()
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT
Select
public void setSelect(java.lang.String select)
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT
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.Select
public DynamoDBQueryExpression<T> withSelect(java.lang.String select)
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
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.Select
public void setSelect(Select select)
Constraints:
Allowed Values: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT
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.Select
public DynamoDBQueryExpression<T> withSelect(Select select)
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
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.Select
public java.lang.String getProjectionExpression()
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.
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.
public void setProjectionExpression(java.lang.String projectionExpression)
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.
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.
public DynamoDBQueryExpression<T> withProjectionExpression(java.lang.String projectionExpression)
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.
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.
public java.lang.String getReturnConsumedCapacity()
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
If 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
, not DynamoDBMapper.query
.
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public void setReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
If 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
, not DynamoDBMapper.query
.
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public DynamoDBQueryExpression<T> withReturnConsumedCapacity(java.lang.String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(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, NONE
If 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
, not DynamoDBMapper.query
.
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
If 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
, not DynamoDBMapper.query
.
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public DynamoDBQueryExpression<T> withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(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, NONE
If 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
, not DynamoDBMapper.query
.
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity