public QuerySpec withAttributesToGet(String... attributes) { getRequest().withAttributesToGet(Arrays.asList(attributes)); return this; }
.withTableName(tableConfig.getTableName()); if (columns != null && !columns.isEmpty()) { scanRequest.withAttributesToGet(columns.stream().map(e -> "properties." + e).collect(Collectors.toList()));
.withAttributesToGet(attributesToGet) .withLimit(limit) .withTableName(tableName)
public QuerySpec withAttributesToGet(String... attributes) { getRequest().withAttributesToGet(Arrays.asList(attributes)); return this; }
@Override public long getMaxVersion(final String materialName) { final List<Map<String, AttributeValue>> items = ddb.query( new QueryRequest() .withTableName(tableName) .withConsistentRead(Boolean.TRUE) .withKeyConditions( Collections.singletonMap( DEFAULT_HASH_KEY, new Condition().withComparisonOperator( ComparisonOperator.EQ).withAttributeValueList( new AttributeValue().withS(materialName)))) .withLimit(1).withScanIndexForward(false) .withAttributesToGet(DEFAULT_RANGE_KEY)).getItems(); if (items.isEmpty()) { return -1L; } else { return Long.parseLong(items.get(0).get(DEFAULT_RANGE_KEY).getN()); } }
@Override public long getMaxVersion(final String materialName) { final List<Map<String, AttributeValue>> items = ddb.query( new QueryRequest() .withTableName(tableName) .withConsistentRead(Boolean.TRUE) .withKeyConditions( Collections.singletonMap( DEFAULT_HASH_KEY, new Condition().withComparisonOperator( ComparisonOperator.EQ).withAttributeValueList( new AttributeValue().withS(materialName)))) .withLimit(1).withScanIndexForward(false) .withAttributesToGet(DEFAULT_RANGE_KEY)).getItems(); if (items.isEmpty()) { return -1L; } else { return Long.parseLong(items.get(0).get(DEFAULT_RANGE_KEY).getN()); } }
.withLimit(this.limit); if (this.select.equals(Select.SPECIFIC_ATTRIBUTES.toString())) { request = request.withAttributesToGet(attrs);
.withLimit(this.limit); if (this.select.equals(Select.SPECIFIC_ATTRIBUTES.toString())) { request = request.withAttributesToGet(attrs);
public static QueryRequest copyQueryRequest(QueryRequest queryRequest) { QueryRequest copiedQueryRequest = new QueryRequest().withAttributesToGet(queryRequest.getAttributesToGet()) .withConsistentRead(queryRequest.getConsistentRead()) .withExclusiveStartKey(queryRequest.getExclusiveStartKey()).withIndexName(queryRequest.getIndexName()) .withKeyConditions(queryRequest.getKeyConditions()).withLimit(queryRequest.getLimit()) .withReturnConsumedCapacity(queryRequest.getReturnConsumedCapacity()) .withScanIndexForward(queryRequest.getScanIndexForward()).withSelect(queryRequest.getSelect()) .withTableName(queryRequest.getTableName()); return copiedQueryRequest; } }