com.amazonaws.services.dynamodbv2.datamodeling
Enum DynamoDBMapperConfig.SaveBehavior

java.lang.Object
  extended by java.lang.Enum<DynamoDBMapperConfig.SaveBehavior>
      extended by com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig.SaveBehavior
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DynamoDBMapperConfig.SaveBehavior>
Enclosing class:
DynamoDBMapperConfig

public static enum DynamoDBMapperConfig.SaveBehavior
extends java.lang.Enum<DynamoDBMapperConfig.SaveBehavior>

Enumeration of behaviors for the save operation.


Enum Constant Summary
APPEND_SET
          APPEND_SET treats scalar attributes (String, Number, Binary) the same as UPDATE_SKIP_NULL_ATTRIBUTES does.
CLOBBER
          CLOBBER will clear and replace all attributes, included unmodeled ones, (delete and recreate) on save.
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.
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.
 
Method Summary
static DynamoDBMapperConfig.SaveBehavior valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DynamoDBMapperConfig.SaveBehavior[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.