public class DynamoDBQueryExpression<T> extends Object
Constructor and Description |
---|
DynamoDBQueryExpression() |
Modifier and Type | Method and Description |
---|---|
String |
getConditionalOperator()
Returns the logical operator on the query filter conditions.
|
Map<String,AttributeValue> |
getExclusiveStartKey()
Returns the exclusive start key for this query.
|
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 |
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> |
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.
Copyright © 2015. All rights reserved.