if (errors.size() != 0) {
throw createInternalServerException(errors);
}
// Check existence of table
Table table = this.tables.get(request.getTableName());
if (table == null) {
throw new ResourceNotFoundException("The table '" + request.getTableName() + "' doesn't exist.");
}
String hashKeyValue = getKeyValue(request.getHashKeyValue());
List<String> attributesToGet = request.getAttributesToGet();
QueryResult queryResult = new QueryResult();
List<Map<String, AttributeValue>> list = new ArrayList<Map<String, AttributeValue>>();
KeySchema keySchema = table.getKeySchema();
KeySchemaElement rangeKeyElement = keySchema.getRangeKeyElement();
ItemRangeGroup rangeGroup = table.getItemRangeGroup(hashKeyValue);
if (rangeGroup != null) {
for (Map<String, AttributeValue> item : rangeGroup.getItems(rangeKeyElement, request.getRangeKeyCondition())) {
if (request.getScanIndexForward() == null || request.getScanIndexForward() == true) {
// The default value is true (forward).
// If ScanIndexForward is not specified, the results are returned in ascending order.