Package com.amazonaws.services.dynamodb.model

Examples of com.amazonaws.services.dynamodb.model.KeySchemaElement


        }

        KeySchema keySchema = desc.getKeySchema();
        if (keySchema != null) {
          jsonWriter.key("KeySchema").object();
          KeySchemaElement hashKeyElement = keySchema.getHashKeyElement();
          if (hashKeyElement != null) {
            jsonWriter.key("HashKeyElement").object();
            if (hashKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(hashKeyElement.getAttributeName());
            }
            if (hashKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(hashKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }
          KeySchemaElement rangeKeyElement = keySchema.getRangeKeyElement();
          if (rangeKeyElement != null) {
            jsonWriter.key("RangeKeyElement").object();
            if (rangeKeyElement.getAttributeName() != null) {
              jsonWriter.key("AttributeName").value(rangeKeyElement.getAttributeName());
            }
            if (rangeKeyElement.getAttributeType() != null) {
              jsonWriter.key("AttributeType").value(rangeKeyElement.getAttributeType());
            }
            jsonWriter.endObject();
          }
          jsonWriter.endObject();
        }
View Full Code Here


    }
  }

  @Test
  public void createTableWithSameHashAndRangeKey() {
    KeySchemaElement el = createStringKeyElement();
    try {
      createTable(createKeySchema(el, el));
      Assert.assertTrue(false);// Should have thrown an exception
    } catch (AmazonServiceException ase) {
    }
View Full Code Here

    }
   
    @Test
    public void queryUpdate() {
        // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void accumulativeUpdate() {
        // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void conditionalUpdateOnHit(){
      // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void conditionalAddNewFieldUpdateOnHit(){
      // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void conditionalPutNewFieldUpdateOnHit(){
      // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void conditionalUpdateOnMissing(){
      // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    }
   
    @Test
    public void conditionalDeleteOldFieldUpdateOnHit(){
      // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
       
        Key key = new Key();
        key.setHashKeyElement(new AttributeValue().withS("1"));
       
View Full Code Here

    //The below is important when mapping number values to integer fields with DynamoDBMapper
    @Test
    public void integerFieldsShouldRemainIntegerOnAdd() throws Exception {
        // Setup table with items
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);

        Map<String, AttributeValue> item = new HashMap<String, AttributeValue>();
        item.put("id", new AttributeValue().withS("1"));
        item.put("value", new AttributeValue().withN("1"));
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodb.model.KeySchemaElement

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.