|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.dynamodb.model.QueryRequest
public class QueryRequest
Container for the parameters to the Query operation
.
The Query operation gets the values of one or more items and its attributes by primary key (composite primary key, only). Narrow the scope of the query using comparison operators on the RangeKeyValue of the composite key. Use the ScanIndexForward parameter to get results in forward or reverse order by range key.
AmazonDynamoDB.query(QueryRequest)
Constructor Summary | |
---|---|
QueryRequest()
Default constructor for a new QueryRequest object. |
|
QueryRequest(String tableName,
AttributeValue hashKeyValue)
Constructs a new QueryRequest object. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
List<String> |
getAttributesToGet()
Array of Attribute names. |
Boolean |
getConsistentRead()
If set to true, then a consistent read is issued, otherwise eventually consistent is used. |
Boolean |
getCount()
If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. |
Key |
getExclusiveStartKey()
Primary key of the item from which to continue an earlier query. |
AttributeValue |
getHashKeyValue()
Attribute value of the hash component of the composite primary key. |
Integer |
getLimit()
The maximum number of items to return. |
Condition |
getRangeKeyCondition()
A container for the attribute values and comparison operators to use for the query. |
Boolean |
getScanIndexForward()
Specifies forward or backward traversal of the index. |
String |
getTableName()
Returns the value of the TableName property for this object. |
int |
hashCode()
|
Boolean |
isConsistentRead()
If set to true, then a consistent read is issued, otherwise eventually consistent is used. |
Boolean |
isCount()
If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. |
Boolean |
isScanIndexForward()
Specifies forward or backward traversal of the index. |
void |
setAttributesToGet(Collection<String> attributesToGet)
Array of Attribute names. |
void |
setConsistentRead(Boolean consistentRead)
If set to true, then a consistent read is issued, otherwise eventually consistent is used. |
void |
setCount(Boolean count)
If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. |
void |
setExclusiveStartKey(Key exclusiveStartKey)
Primary key of the item from which to continue an earlier query. |
void |
setHashKeyValue(AttributeValue hashKeyValue)
Attribute value of the hash component of the composite primary key. |
void |
setLimit(Integer limit)
The maximum number of items to return. |
void |
setRangeKeyCondition(Condition rangeKeyCondition)
A container for the attribute values and comparison operators to use for the query. |
void |
setScanIndexForward(Boolean scanIndexForward)
Specifies forward or backward traversal of the index. |
void |
setTableName(String tableName)
Sets the value of the TableName property for this object. |
String |
toString()
Returns a string representation of this object; useful for testing and debugging. |
QueryRequest |
withAttributesToGet(Collection<String> attributesToGet)
Array of Attribute names. |
QueryRequest |
withAttributesToGet(String... attributesToGet)
Array of Attribute names. |
QueryRequest |
withConsistentRead(Boolean consistentRead)
If set to true, then a consistent read is issued, otherwise eventually consistent is used. |
QueryRequest |
withCount(Boolean count)
If set to true, Amazon DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. |
QueryRequest |
withExclusiveStartKey(Key exclusiveStartKey)
Primary key of the item from which to continue an earlier query. |
QueryRequest |
withHashKeyValue(AttributeValue hashKeyValue)
Attribute value of the hash component of the composite primary key. |
QueryRequest |
withLimit(Integer limit)
The maximum number of items to return. |
QueryRequest |
withRangeKeyCondition(Condition rangeKeyCondition)
A container for the attribute values and comparison operators to use for the query. |
QueryRequest |
withScanIndexForward(Boolean scanIndexForward)
Specifies forward or backward traversal of the index. |
QueryRequest |
withTableName(String tableName)
Sets the value of the TableName property for this object. |
Methods inherited from class com.amazonaws.AmazonWebServiceRequest |
---|
copyPrivateRequestParameters, getRequestClientOptions, getRequestCredentials, setRequestCredentials |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryRequest()
public QueryRequest(String tableName, AttributeValue hashKeyValue)
tableName
- hashKeyValue
- Attribute value of the hash component of the
composite primary key.Method Detail |
---|
public String getTableName()
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
public void setTableName(String tableName)
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName
- The new value for the TableName property for this object.public QueryRequest withTableName(String tableName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName
- The new value for the TableName property for this object.
public List<String> getAttributesToGet()
Constraints:
Length: 1 -
public void setAttributesToGet(Collection<String> attributesToGet)
Constraints:
Length: 1 -
attributesToGet
- Array of Attribute names. If attribute names are not specified then
all attributes will be returned. If some attributes are not found,
they will not appear in the result.public QueryRequest withAttributesToGet(String... attributesToGet)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- Array of Attribute names. If attribute names are not specified then
all attributes will be returned. If some attributes are not found,
they will not appear in the result.
public QueryRequest withAttributesToGet(Collection<String> attributesToGet)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- Array of Attribute names. If attribute names are not specified then
all attributes will be returned. If some attributes are not found,
they will not appear in the result.
public Integer getLimit()
Constraints:
Range: 1 -
public void setLimit(Integer limit)
Constraints:
Range: 1 -
limit
- The maximum number of items to return. If Amazon DynamoDB hits this
limit while querying the table, it stops the query and returns the
matching values up to the limit, and a LastEvaluatedKey to apply in a
subsequent operation to continue the query. Also, if the result set
size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the
query and returns the matching values, and a LastEvaluatedKey to apply
in a subsequent operation to continue the query.public QueryRequest withLimit(Integer limit)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 -
limit
- The maximum number of items to return. If Amazon DynamoDB hits this
limit while querying the table, it stops the query and returns the
matching values up to the limit, and a LastEvaluatedKey to apply in a
subsequent operation to continue the query. Also, if the result set
size exceeds 1MB before Amazon DynamoDB hits this limit, it stops the
query and returns the matching values, and a LastEvaluatedKey to apply
in a subsequent operation to continue the query.
public Boolean isConsistentRead()
public void setConsistentRead(Boolean consistentRead)
consistentRead
- If set to true, then a consistent read is issued, otherwise eventually
consistent is used.public QueryRequest withConsistentRead(Boolean consistentRead)
Returns a reference to this object so that method calls can be chained together.
consistentRead
- If set to true, then a consistent read is issued, otherwise eventually
consistent is used.
public Boolean getConsistentRead()
public Boolean isCount()
public void setCount(Boolean count)
count
- If set to true, Amazon DynamoDB returns a total number of items that
match the query parameters, instead of a list of the matching items
and their attributes. Do not set Count to true while providing a list
of AttributesToGet, otherwise Amazon DynamoDB returns a validation
error.public QueryRequest withCount(Boolean count)
Returns a reference to this object so that method calls can be chained together.
count
- If set to true, Amazon DynamoDB returns a total number of items that
match the query parameters, instead of a list of the matching items
and their attributes. Do not set Count to true while providing a list
of AttributesToGet, otherwise Amazon DynamoDB returns a validation
error.
public Boolean getCount()
public AttributeValue getHashKeyValue()
public void setHashKeyValue(AttributeValue hashKeyValue)
hashKeyValue
- Attribute value of the hash component of the composite primary key.public QueryRequest withHashKeyValue(AttributeValue hashKeyValue)
Returns a reference to this object so that method calls can be chained together.
hashKeyValue
- Attribute value of the hash component of the composite primary key.
public Condition getRangeKeyCondition()
public void setRangeKeyCondition(Condition rangeKeyCondition)
rangeKeyCondition
- A container for the attribute values and comparison operators to use
for the query.public QueryRequest withRangeKeyCondition(Condition rangeKeyCondition)
Returns a reference to this object so that method calls can be chained together.
rangeKeyCondition
- A container for the attribute values and comparison operators to use
for the query.
public Boolean isScanIndexForward()
public void setScanIndexForward(Boolean scanIndexForward)
scanIndexForward
- Specifies forward or backward traversal of the index. Amazon DynamoDB
returns results reflecting the requested order, determined by the
range key. Default is true (forward).public QueryRequest withScanIndexForward(Boolean scanIndexForward)
Returns a reference to this object so that method calls can be chained together.
scanIndexForward
- Specifies forward or backward traversal of the index. Amazon DynamoDB
returns results reflecting the requested order, determined by the
range key. Default is true (forward).
public Boolean getScanIndexForward()
public Key getExclusiveStartKey()
public void setExclusiveStartKey(Key exclusiveStartKey)
exclusiveStartKey
- Primary key of the item from which to continue an earlier query. An
earlier query might provide this value as the LastEvaluatedKey if that
query operation was interrupted before completing the query; either
because of the result set size or the Limit parameter. The
LastEvaluatedKey can be passed back in a new query request to continue
the operation from that point.public QueryRequest withExclusiveStartKey(Key exclusiveStartKey)
Returns a reference to this object so that method calls can be chained together.
exclusiveStartKey
- Primary key of the item from which to continue an earlier query. An
earlier query might provide this value as the LastEvaluatedKey if that
query operation was interrupted before completing the query; either
because of the result set size or the Limit parameter. The
LastEvaluatedKey can be passed back in a new query request to continue
the operation from that point.
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |