Package com.amazonaws.services.dynamodb.model

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


    }
   
    @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

        Assert.assertNotNull(result.getAttributes());
    }

    @Test
    public void deleteItemWithoutTableName() {
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
        AttributeValue hash = createStringAttribute();
        getClient().putItem(new PutItemRequest().withTableName(tableName).withItem(createGenericItem(hash)));
        DeleteItemRequest request = new DeleteItemRequest().withKey(new Key(hash));
    try {
View Full Code Here

    }
    }

    @Test
    public void deleteNonExistantItem() {
        KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
        createTable(tableName, schema);
        DeleteItemRequest request = new DeleteItemRequest().withTableName(tableName).withKey(new Key(createStringAttribute()));
    try {
      getClient().deleteItem(request);
      Assert.assertTrue(false);// Should have thrown an exception
View Full Code Here

    }
    }

  @Test
  public void putItemWithExpected() {
    KeySchema schema = new KeySchema(new KeySchemaElement().withAttributeName("id").withAttributeType(ScalarAttributeType.S));
    createTable(tableName, schema);

    AttributeValue value = new AttributeValue("test1");
    Map<String, ExpectedAttributeValue> expectedMap = new HashMap<String, ExpectedAttributeValue>();
    expectedMap.put("id", new ExpectedAttributeValue(false));
View Full Code Here

TOP

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

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.