Package com.michelboudreau.alternator.models

Examples of com.michelboudreau.alternator.models.Table


    result.setScannedCount(items.size());
    return result;
  }

  public com.amazonaws.services.dynamodbv2.model.ScanResult scanV2(com.amazonaws.services.dynamodbv2.model.ScanRequest v2Request) {
        Table table = this.tables.get(v2Request.getTableName());
        ScanRequest request = AlternatorDBApiVersion2Mapper.MapV2ScanRequestToV1(v2Request, table);
        ScanResult result = scan(request);
        return AlternatorDBApiVersion2Mapper.MapV1ScanResultToV2(result, table);
  }
View Full Code Here


    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.
View Full Code Here

    return queryResult;
  }

  public com.amazonaws.services.dynamodbv2.model.QueryResult queryV2(com.amazonaws.services.dynamodbv2.model.QueryRequest v2Request) {
        Table table = this.tables.get(v2Request.getTableName());
        QueryRequest request = AlternatorDBApiVersion2Mapper.MapV2QueryRequestToV1(v2Request, table);
        QueryResult result = query(request);
        return AlternatorDBApiVersion2Mapper.MapV1QueryResultToV2(result, table);
  }
View Full Code Here

    }
    return result;
  }

  public com.amazonaws.services.dynamodbv2.model.UpdateItemResult updateItemV2(com.amazonaws.services.dynamodbv2.model.UpdateItemRequest v2Request) {
        Table table = this.tables.get(v2Request.getTableName());
        UpdateItemRequest request = AlternatorDBApiVersion2Mapper.MapV2UpdateItemRequestToV1(v2Request, table);
    try {
      UpdateItemResult result = updateItem(request);
      return AlternatorDBApiVersion2Mapper.MapV1UpdateItemResultToV2(result, v2Request.getTableName());
    } catch (ConditionalCheckFailedException ccfev1) {
View Full Code Here

TOP

Related Classes of com.michelboudreau.alternator.models.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.