Enum DynamoDBMapperConfig.SaveBehavior

    • Enum Constant Detail

      • UPDATE

        public static final DynamoDBMapperConfig.SaveBehavior UPDATE
        UPDATE will not affect unmodeled attributes on a save operation and a null value for the modeled attribute will remove it from that item in DynamoDB.

        Because of the limitation of updateItem request, the implementation of UPDATE will send a putItem request when a key-only object is being saved, and it will send another updateItem request if the given key(s) already exists in the table.

        By default, the mapper uses UPDATE.

      • UPDATE_SKIP_NULL_ATTRIBUTES

        public static final DynamoDBMapperConfig.SaveBehavior UPDATE_SKIP_NULL_ATTRIBUTES
        UPDATE_SKIP_NULL_ATTRIBUTES is similar to UPDATE, except that it ignores any null value attribute(s) and will NOT remove them from that item in DynamoDB. It also guarantees to send only one single updateItem request, no matter the object is key-only or not.
      • CLOBBER

        public static final DynamoDBMapperConfig.SaveBehavior CLOBBER
        CLOBBER will clear and replace all attributes, included unmodeled ones, (delete and recreate) on save. Versioned field constraints will also be disregarded.
      • APPEND_SET

        public static final DynamoDBMapperConfig.SaveBehavior APPEND_SET
        APPEND_SET treats scalar attributes (String, Number, Binary) the same as UPDATE_SKIP_NULL_ATTRIBUTES does. However, for set attributes, it will append to the existing attribute value, instead of overriding it. Caller needs to make sure that the modeled attribute type matches the existing set type, otherwise it would result in a service exception.
    • Method Detail

      • values

        public static DynamoDBMapperConfig.SaveBehavior[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DynamoDBMapperConfig.SaveBehavior c : DynamoDBMapperConfig.SaveBehavior.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DynamoDBMapperConfig.SaveBehavior valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null