|
|||||||
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
.
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()
List of Attribute names. |
Boolean |
getConsistentRead()
If set to true , then a consistent read is issued. |
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()
The name of the table in which you want to query. |
int |
hashCode()
|
Boolean |
isConsistentRead()
If set to true , then a consistent read is issued. |
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)
List of Attribute names. |
void |
setConsistentRead(Boolean consistentRead)
If set to true , then a consistent read is issued. |
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)
The name of the table in which you want to query. |
String |
toString()
Returns a string representation of this object; useful for testing and debugging. |
QueryRequest |
withAttributesToGet(Collection<String> attributesToGet)
List of Attribute names. |
QueryRequest |
withAttributesToGet(String... attributesToGet)
List of Attribute names. |
QueryRequest |
withConsistentRead(Boolean consistentRead)
If set to true , then a consistent read is issued. |
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)
The name of the table in which you want to query. |
Methods inherited from class com.amazonaws.AmazonWebServiceRequest |
---|
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, 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
- The name of the table in which you want to query.
Allowed characters are a-z
, A-Z
,
0-9
, _
(underscore), -
(hyphen)
and .
(period).hashKeyValue
- Attribute value of the hash component of the
composite primary key.Method Detail |
---|
public String getTableName()
a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).public void setTableName(String tableName)
a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName
- The name of the table in which you want to query. Allowed characters
are a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).public QueryRequest withTableName(String tableName)
a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).
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 name of the table in which you want to query. Allowed characters
are a-z
, A-Z
, 0-9
,
_
(underscore), -
(hyphen) and
.
(period).
public List<String> getAttributesToGet()
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.
Constraints:
Length: 1 -
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 void setAttributesToGet(Collection<String> attributesToGet)
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.
Constraints:
Length: 1 -
attributesToGet
- List 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)
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.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- List 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)
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.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet
- List 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()
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.
Constraints:
Range: 1 -
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 void setLimit(Integer limit)
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.
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)
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.
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()
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.public void setConsistentRead(Boolean consistentRead)
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.
consistentRead
- If set to true
, then a consistent read is issued.
Otherwise eventually-consistent is used.public QueryRequest withConsistentRead(Boolean consistentRead)
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.
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()
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.
true
, then a consistent read is issued.
Otherwise eventually-consistent is used.public Boolean isCount()
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.
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 void setCount(Boolean count)
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.
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)
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.
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()
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.
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 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()
true
(forward).
true
(forward).public void setScanIndexForward(Boolean scanIndexForward)
true
(forward).
scanIndexForward
- Specifies forward or backward traversal of the index. Amazon DynamoDB
returns results reflecting the requested order, determined by the
range key. The default value is true
(forward).public QueryRequest withScanIndexForward(Boolean scanIndexForward)
true
(forward).
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. The default value is true
(forward).
public Boolean getScanIndexForward()
true
(forward).
true
(forward).public Key getExclusiveStartKey()
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.
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 void setExclusiveStartKey(Key exclusiveStartKey)
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.
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)
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.
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 |