public class DynamoDBQueryExpression<T> extends Object
Constructor and Description |
---|
DynamoDBQueryExpression() |
Modifier and Type | Method and 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.
|
Integer |
getLimit()
Returns the maximum number of items to retrieve in each service request
to DynamoDB.
|
Map<String,Condition> |
getQueryFilter()
Returns the query filter applied on this query.
|
Map<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(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 |
setLimit(Integer limit)
Sets the maximum number of items to retrieve in each service request to
DynamoDB.
|
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 |
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(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> |
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> |
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> |
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)
public DynamoDBQueryExpression<T> withConsistentRead(boolean consistentRead)
public boolean isScanIndexForward()
public void setScanIndexForward(boolean scanIndexForward)
public DynamoDBQueryExpression<T> withScanIndexForward(boolean scanIndexForward)
public Map<String,AttributeValue> getExclusiveStartKey()
public void setExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
public DynamoDBQueryExpression<T> withExclusiveStartKey(Map<String,AttributeValue> exclusiveStartKey)
public 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(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(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 Map<String,Condition> getRangeKeyConditions()
public void setRangeKeyConditions(Map<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(Map<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(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 String getIndexName()
public void setIndexName(String indexName)
DynamoDBIndexHashKey
or DynamoDBIndexRangeKey
annotations to the appropriate getter methods of the mapped
object.public DynamoDBQueryExpression<T> withIndexName(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 Map<String,Condition> getQueryFilter()
public void setQueryFilter(Map<String,Condition> queryFilter)
public DynamoDBQueryExpression<T> withQueryFilter(Map<String,Condition> queryFilter)
Returns a pointer to this object for method-chaining.
public DynamoDBQueryExpression<T> withQueryFilterEntry(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 String getConditionalOperator()
public void setConditionalOperator(String conditionalOperator)
public DynamoDBQueryExpression<T> withConditionalOperator(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 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(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(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 Map<String,String> getExpressionAttributeNames()
QueryRequest.getExpressionAttributeNames()
public void setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
expressionAttributeNames
- One or more substitution variables for simplifying complex
expressions.QueryRequest.setExpressionAttributeNames(Map)
public DynamoDBQueryExpression<T> withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
expressionAttributeNames
- One or more substitution variables for simplifying complex
expressions.QueryRequest.withExpressionAttributeNames(Map)
public DynamoDBQueryExpression<T> addExpressionAttributeNamesEntry(String key, 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 Map<String,AttributeValue> getExpressionAttributeValues()
QueryRequest.getExpressionAttributeValues()
public void setExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
expressionAttributeValues
- One or more values that can be substituted in an expression.QueryRequest.setExpressionAttributeValues(Map)
public DynamoDBQueryExpression<T> withExpressionAttributeValues(Map<String,AttributeValue> expressionAttributeValues)
expressionAttributeValues
- One or more values that can be substituted in an expression.QueryRequest.withExpressionAttributeValues(Map)
public DynamoDBQueryExpression<T> addExpressionAttributeValuesEntry(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.
Copyright © 2015. All rights reserved.