/** * When a key condition expression is specified, the corresponding name-map * and value-map can optionally be specified via {@link #withNameMap(Map)} * and {@link #withValueMap(Map)}. (Note the hash key and range key * conditions must not be specified if a key condition expression has been * specified.) */ public QuerySpec withKeyConditionExpression(String keyConditionExpression) { getRequest().withKeyConditionExpression(keyConditionExpression); return this; }
public QuerySpec withScanIndexForward(boolean scanIndexForward) { getRequest().withScanIndexForward(scanIndexForward); return this; }
public QuerySpec withReturnConsumedCapacity( ReturnConsumedCapacity returnConsumedCapacity) { getRequest().setReturnConsumedCapacity(returnConsumedCapacity); return this; }
public QuerySpec withConsistentRead(boolean consistentRead) { getRequest().setConsistentRead(consistentRead); return this; }
/** * When a filter expression is specified, the corresponding name-map and * value-map can optionally be specified via {@link #withNameMap(Map)} and * {@link #withValueMap(Map)}. (Note query filters must not be specified if * a filter expression has been specified.) */ public QuerySpec withFilterExpression(String filterExpression) { getRequest().withFilterExpression(filterExpression); return this; }
/** * When a projection expression is specified, the corresponding name-map and * value-map can optionally be specified via {@link #withNameMap(Map)} and * {@link #withValueMap(Map)}. (Note attributes-to-get must not be specified * if a projection expression has been specified.) */ public QuerySpec withProjectionExpression(String projectionExpression) { getRequest().withProjectionExpression(projectionExpression); return this; }
public QueryCollection(AmazonDynamoDB client, QuerySpec spec) { this.client = client; this.spec = spec; Map<String, AttributeValue> startKey = spec.getRequest().getExclusiveStartKey(); this.startKey = startKey == null ? null : new LinkedHashMap<String, AttributeValue>(startKey); }
public List<String> getAttributesToGet() { return getRequest().getAttributesToGet(); }
public String getReturnConsumedCapacity() { return getRequest().getReturnConsumedCapacity(); }
public QuerySpec withConditionalOperator(ConditionalOperator op) { getRequest().withConditionalOperator(op); return this; }
public QuerySpec withAttributesToGet(String... attributes) { getRequest().withAttributesToGet(Arrays.asList(attributes)); return this; }
public QuerySpec withSelect(Select select) { getRequest().withSelect(select); return this; }
public String getConditionalOperator() { return getRequest().getConditionalOperator(); }
public boolean isConsistentRead() { return getRequest().isConsistentRead(); }
public String getFilterExpression() { return getRequest().getFilterExpression(); }
public String getSelect() { return getRequest().getSelect(); }
public String getKeyConditionExpression() { return getRequest().getKeyConditionExpression(); }
public String getProjectionExpression() { return getRequest().getProjectionExpression(); }
@Override protected ItemCollection<QueryOutcome> doQuery(QuerySpec spec) { spec.getRequest().setIndexName(index.getIndexName()); return super.doQuery(spec); } }
@Override public Page<Item, QueryOutcome> firstPage() { QueryRequest request = spec.getRequest(); request.setExclusiveStartKey(startKey); request.setLimit(InternalUtils.minimum( spec.getMaxResultSize(), spec.getMaxPageSize())); QueryResult result = client.query(request); QueryOutcome outcome = new QueryOutcome(result); setLastLowLevelResult(outcome); return new QueryPage(client, spec, request, 0, outcome); }