T
- the hash key value.public class DynamoDBQueryExpression<T>
extends java.lang.Object
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 key condition expression to be used by this query.
|
java.lang.Integer |
getLimit()
Returns the maximum number of items to retrieve in each service request
to DynamoDB.
|
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.
|
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 key condition expression to be used by this query.
|
void |
setLimit(java.lang.Integer limit)
Sets the maximum number of items to retrieve in each service request to
DynamoDB.
|
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 |
setScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward.
|
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)
Sets the key condition expression to be used by this query.
|
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> |
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> |
withScanIndexForward(boolean scanIndexForward)
Sets whether this query scans forward and returns a pointer to this
object for method-chaining.
|
public boolean isConsistentRead()
public void setConsistentRead(boolean consistentRead)
consistentRead
- set consistent read operation.public DynamoDBQueryExpression<T> withConsistentRead(boolean consistentRead)
consistentRead
- set consistent read operation.DynamoDBQueryExpression
for chainingpublic boolean isScanIndexForward()
public void setScanIndexForward(boolean scanIndexForward)
scanIndexForward
- set query scans forward.public DynamoDBQueryExpression<T> withScanIndexForward(boolean scanIndexForward)
scanIndexForward
- set query scans forward.DynamoDBQueryExpression
for chainingpublic java.util.Map<java.lang.String,AttributeValue> getExclusiveStartKey()
public void setExclusiveStartKey(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
exclusiveStartKey
- a map of string to attribute value representing
exlusive start keypublic DynamoDBQueryExpression<T> withExclusiveStartKey(java.util.Map<java.lang.String,AttributeValue> exclusiveStartKey)
exclusiveStartKey
- a map of string to attribute value representing
exlusive start keyDynamoDBQueryExpression
for chainingpublic 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.
limit
- the query limitpublic 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.
limit
- the query limitDynamoDBQueryExpression
for chainingpublic T getHashKeyValues()
public void setHashKeyValues(T hashKeyValues)
hashKeyValues
- the hash key values.public DynamoDBQueryExpression<T> withHashKeyValues(T hashKObject)
hashKObject
- the hash key values.DynamoDBQueryExpression
for chainingpublic 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.DynamoDBQueryExpression
for chainingpublic 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.DynamoDBQueryExpression
for chainingpublic java.lang.String getIndexName()
public void setIndexName(java.lang.String indexName)
DynamoDBIndexHashKey
or DynamoDBIndexRangeKey
annotations
to the appropriate getter methods of the mapped object.indexName
- the index name to use for the query.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.
indexName
- the index name to use for the query.DynamoDBQueryExpression
for chainingpublic java.lang.String getKeyConditionExpression()
public void setKeyConditionExpression(java.lang.String keyConditionExpression)
keyConditionExpression
- the key condition expression to use for the query.public DynamoDBQueryExpression<T> withKeyConditionExpression(java.lang.String keyConditionExpression)
Returns a pointer to this object for method-chaining.
keyConditionExpression
- the key condition expression to use for the query.DynamoDBQueryExpression
for chainingpublic java.util.Map<java.lang.String,Condition> getQueryFilter()
Condition
representing the query
filter.public void setQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
queryFilter
- a map of string to Condition
representing the
query filter.public DynamoDBQueryExpression<T> withQueryFilter(java.util.Map<java.lang.String,Condition> queryFilter)
Returns a pointer to this object for method-chaining.
queryFilter
- a map of string to Condition
representing the
query filter.DynamoDBQueryExpression
for chainingpublic 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.DynamoDBQueryExpression
for chainingvpublic java.lang.String getConditionalOperator()
public void setConditionalOperator(java.lang.String conditionalOperator)
conditionalOperator
- the conditional operator.public DynamoDBQueryExpression<T> withConditionalOperator(java.lang.String conditionalOperator)
Returns a pointer to this object for method-chaining.
conditionalOperator
- the conditional operator.DynamoDBQueryExpression
for chainingpublic void setConditionalOperator(ConditionalOperator conditionalOperator)
conditionalOperator
- the conditional operator.spublic DynamoDBQueryExpression<T> withConditionalOperator(ConditionalOperator conditionalOperator)
Returns a pointer to this object for method-chaining.
conditionalOperator
- the conditional operator.DynamoDBQueryExpression
for chainingvpublic 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.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.DynamoDBQueryExpression
for chainingvQueryRequest.addExpressionAttributeNamesEntry(String, String)
public DynamoDBQueryExpression<T> clearExpressionAttributeNamesEntries()
Returns a reference to this object so that method calls can be chained together.
DynamoDBQueryExpression
for chainingpublic 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.DynamoDBQueryExpression
for chainingQueryRequest.addExpressionAttributeValuesEntry(String,
AttributeValue)
public DynamoDBQueryExpression<T> clearExpressionAttributeValuesEntries()
Returns a reference to this object so that method calls can be chained together.
DynamoDBQueryExpression
for chainingCopyright © 2018 Amazon Web Services, Inc. All Rights Reserved.