Examples of Expected


Examples of com.amazonaws.services.dynamodbv2.document.Expected

        System.out.println(table.getItemOutcome(HASH_KEY, FIRST_CUSTOMER_ID, RANGE_KEY, ADDRESS_TYPE_WORK));
        try {
            table.updateItem(HASH_KEY, FIRST_CUSTOMER_ID, RANGE_KEY, ADDRESS_TYPE_WORK,
                // Specifies the criteria that the "phone" attribute must exist
                // as a precondition to adding the phone number
                Arrays.asList(new Expected("phone").exists()),
                // Adds the phone number if the expectation is satisfied
                new AttributeUpdate("phone").addElements(phoneNumberToAdd));
            fail("Update Should fail as the phone number attribute is not present in the row");
        } catch (AmazonServiceException expected) {
            // Failed the criteria as expected
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.