Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.dynamodbv2.datamodeling
Class DynamoDBQueryExpression<T>

java.lang.Object
  extended by com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T>

public class DynamoDBQueryExpression<T>
extends Object

A query expression


Constructor Summary
DynamoDBQueryExpression()
           
 
Method Summary
 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 used by this query.
 Integer getLimit()
          Returns the limit of items to return from 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 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 limit of items to return from 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> 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 limit of items to return from this query and returns a pointer to this object for method-chaining.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamoDBQueryExpression

public DynamoDBQueryExpression()
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 limit of items to return from this query.


setLimit

public void setLimit(Integer limit)
Sets the limit of items to return from this query.


withLimit

public DynamoDBQueryExpression<T> withLimit(Integer limit)
Sets the limit of items to return from this query and returns a pointer to this object for method-chaining.


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.


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 - NOTE: The current DynamoDB service only allows up to one range key condition per query. Providing more than one range key conditions 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 - NOTE: The current DynamoDB service only allows up to one range key condition per query. Providing more than one range key conditions 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 using @DynamoDBRangeKey or @DynamoDBIndexRangeKey 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 either setIndexName(String) or withIndexName(String).

Parameters:
rangeKeyAttributeName - This could 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 used by this query.


setIndexName

public void setIndexName(String indexName)
Sets the name of the index to be used by this query. All index names must be specified by using @DynamoDBIndexRangeKey annotation on the getter method of the corresponding index range key before executing the query.


withIndexName

public DynamoDBQueryExpression<T> withIndexName(String indexName)
Sets the name of the index to be used by this query. All index names must be specified by using @DynamoDBIndexRangeKey annotation on the getter method of the corresponding index range key before executing the query.

Returns a pointer to this object for method-chaining.



Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.