com.amazonaws.services.dynamodbv2.datamodeling
Class DynamoDBMapper

java.lang.Object
  extended by com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper

Deprecated. These classes have been deprecated, please use the classes in the com.amazonaws.mobileconnectors namespace.

public class DynamoDBMapper
extends java.lang.Object

Object mapper for domain-object interaction with DynamoDB.

To use, define a domain class that represents an item in a DynamoDB table and annotate it with the annotations found in the com.amazonaws.services.dynamodbv2.datamodeling package. In order to allow the mapper to correctly persist the data, each modeled property in the domain class should be accessible via getter and setter methods, and each property annotation should be either applied to the getter method or the class field. A minimal example using getter annotations:

 @DynamoDBTable(tableName = "TestTable")
 public class TestClass {

     private Long key;
     private double rangeKey;
     private Long version;

     private Set<Integer> integerSetAttribute;

     @DynamoDBHashKey
     public Long getKey() {
         return key;
     }

     public void setKey(Long key) {
         this.key = key;
     }

     @DynamoDBRangeKey
     public double getRangeKey() {
         return rangeKey;
     }

     public void setRangeKey(double rangeKey) {
         this.rangeKey = rangeKey;
     }

     @DynamoDBAttribute(attributeName = "integerSetAttribute")
     public Set<Integer> getIntegerAttribute() {
         return integerSetAttribute;
     }

     public void setIntegerAttribute(Set<Integer> integerAttribute) {
         this.integerSetAttribute = integerAttribute;
     }

     @DynamoDBVersionAttribute
     public Long getVersion() {
         return version;
     }

     public void setVersion(Long version) {
         this.version = version;
     }
 }
 

Save instances of annotated classes to DynamoDB, retrieve them, and delete them using the DynamoDBMapper class, as in the following example.

 DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBClient);
 Long hashKey = 105L;
 double rangeKey = 1.0d;
 TestClass obj = mapper.load(TestClass.class, hashKey, rangeKey);
 obj.getIntegerAttribute().add(42);
 mapper.save(obj);
 mapper.delete(obj);
 

When using the save, load, and delete methods, DynamoDBMapper will throw DynamoDBMappingExceptions to indicate that domain classes are incorrectly annotated or otherwise incompatible with this class. Service exceptions will always be propagated as AmazonClientException, and DynamoDB-specific subclasses such as ConditionalCheckFailedException will be used when possible.

This class is thread-safe and can be shared between threads. It's also very lightweight, so it doesn't need to be.

See Also:
DynamoDBTable, DynamoDBHashKey, DynamoDBRangeKey, DynamoDBAutoGeneratedKey, DynamoDBAttribute, DynamoDBVersionAttribute, DynamoDBIgnore, DynamoDBMarshalling, DynamoDBMapperConfig

Nested Class Summary
static class DynamoDBMapper.FailedBatch
          Deprecated. The return type of batchWrite, batchDelete and batchSave.
 
Constructor Summary
DynamoDBMapper(AmazonDynamoDB dynamoDB)
          Deprecated. Constructs a new mapper with the service object given, using the default configuration.
DynamoDBMapper(AmazonDynamoDB ddb, AWSCredentialsProvider s3CredentialProvider)
          Deprecated. Constructs a new mapper with the service object and S3 client cache given, using the default configuration.
DynamoDBMapper(AmazonDynamoDB dynamoDB, DynamoDBMapperConfig config)
          Deprecated. Constructs a new mapper with the service object and configuration given.
DynamoDBMapper(AmazonDynamoDB dynamoDB, DynamoDBMapperConfig config, AttributeTransformer transformer)
          Deprecated. Constructs a new mapper with the given service object, configuration, and transform hook.
DynamoDBMapper(AmazonDynamoDB dynamoDB, DynamoDBMapperConfig config, AttributeTransformer transformer, AWSCredentialsProvider s3CredentialsProvider)
          Deprecated. Constructor with all parameters.
DynamoDBMapper(AmazonDynamoDB dynamoDB, DynamoDBMapperConfig config, AWSCredentialsProvider s3CredentialProvider)
          Deprecated. Constructs a new mapper with the service object, configuration, and S3 client cache given.
 
Method Summary
 java.util.List<DynamoDBMapper.FailedBatch> batchDelete(java.util.List<? extends java.lang.Object> objectsToDelete)
          Deprecated. Deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 java.util.List<DynamoDBMapper.FailedBatch> batchDelete(java.lang.Object... objectsToDelete)
          Deprecated. Deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.List<java.lang.Object> itemsToGet)
          Deprecated. Retrieves multiple items from multiple tables using their primary keys.
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.List<java.lang.Object> itemsToGet, DynamoDBMapperConfig config)
          Deprecated. Retrieves multiple items from multiple tables using their primary keys.
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.Map<java.lang.Class<?>,java.util.List<KeyPair>> itemsToGet)
          Deprecated. Retrieves the attributes for multiple items from multiple tables using their primary keys.
 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.Map<java.lang.Class<?>,java.util.List<KeyPair>> itemsToGet, DynamoDBMapperConfig config)
          Deprecated. Retrieves multiple items from multiple tables using their primary keys.
 java.util.List<DynamoDBMapper.FailedBatch> batchSave(java.util.List<? extends java.lang.Object> objectsToSave)
          Deprecated. Saves the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 java.util.List<DynamoDBMapper.FailedBatch> batchSave(java.lang.Object... objectsToSave)
          Deprecated. Saves the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 java.util.List<DynamoDBMapper.FailedBatch> batchWrite(java.util.List<? extends java.lang.Object> objectsToWrite, java.util.List<? extends java.lang.Object> objectsToDelete)
          Deprecated. Saves and deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 java.util.List<DynamoDBMapper.FailedBatch> batchWrite(java.util.List<? extends java.lang.Object> objectsToWrite, java.util.List<? extends java.lang.Object> objectsToDelete, DynamoDBMapperConfig config)
          Deprecated. Saves and deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
 int count(java.lang.Class<?> clazz, DynamoDBScanExpression scanExpression)
          Deprecated. Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.
 int count(java.lang.Class<?> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
          Deprecated. Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data.
<T> int
count(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
          Deprecated. Evaluates the specified query expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.
<T> int
count(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
          Deprecated. Evaluates the specified query expression and returns the count of matching items, without returning any of the actual item data.
 S3Link createS3Link(Region s3region, java.lang.String bucketName, java.lang.String key)
          Deprecated. Creates an S3Link with the specified region, bucket name and key.
 S3Link createS3Link(java.lang.String bucketName, java.lang.String key)
          Deprecated. Creates an S3Link with the specified bucket name and key using the default S3 region.
 void delete(java.lang.Object object)
          Deprecated. Deletes the given object from its DynamoDB table using the default configuration.
 void delete(java.lang.Object object, DynamoDBDeleteExpression deleteExpression)
          Deprecated. Deletes the given object from its DynamoDB table using the specified deleteExpression and default configuration.
 void delete(java.lang.Object object, DynamoDBMapperConfig config)
          Deprecated. Deletes the given object from its DynamoDB table using the specified configuration.
<T> void
delete(T object, DynamoDBDeleteExpression deleteExpression, DynamoDBMapperConfig config)
          Deprecated. Deletes the given object from its DynamoDB table using the provided deleteExpression and provided configuration.
 CreateTableRequest generateCreateTableRequest(java.lang.Class<?> clazz)
          Deprecated. Parse the given POJO class and return the CreateTableRequest for the DynamoDB table it represents.
 S3ClientCache getS3ClientCache()
          Deprecated. Returns the underlying S3ClientCache for accessing S3.
<T> T
load(java.lang.Class<T> clazz, java.lang.Object hashKey)
          Deprecated. Loads an object with the hash key given, using the default configuration.
<T> T
load(java.lang.Class<T> clazz, java.lang.Object hashKey, DynamoDBMapperConfig config)
          Deprecated. Loads an object with the hash key given and a configuration override.
<T> T
load(java.lang.Class<T> clazz, java.lang.Object hashKey, java.lang.Object rangeKey)
          Deprecated. Loads an object with a hash and range key, using the default configuration.
<T> T
load(java.lang.Class<T> clazz, java.lang.Object hashKey, java.lang.Object rangeKey, DynamoDBMapperConfig config)
          Deprecated. Returns an object with the given hash key, or null if no such object exists.
<T> T
load(T keyObject)
          Deprecated. Returns an object whose keys match those of the prototype key object given, or null if no such item exists.
<T> T
load(T keyObject, DynamoDBMapperConfig config)
          Deprecated. Returns an object whose keys match those of the prototype key object given, or null if no such item exists.
<T> T
marshallIntoObject(java.lang.Class<T> clazz, java.util.Map<java.lang.String,AttributeValue> itemAttributes)
          Deprecated. as an extension point for adding custom unmarshalling
<T> java.util.List<T>
marshallIntoObjects(java.lang.Class<T> clazz, java.util.List<java.util.Map<java.lang.String,AttributeValue>> itemAttributes)
          Deprecated. as an extension point for adding custom unmarshalling
<T> PaginatedParallelScanList<T>
parallelScan(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments)
          Deprecated. Scans through an Amazon DynamoDB table on logically partitioned segments in parallel and returns the matching results in one unmodifiable list of instantiated objects, using the default configuration.
<T> PaginatedParallelScanList<T>
parallelScan(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments, DynamoDBMapperConfig config)
          Deprecated. Scans through an Amazon DynamoDB table on logically partitioned segments in parallel.
<T> PaginatedQueryList<T>
query(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
          Deprecated. Queries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.
<T> PaginatedQueryList<T>
query(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
          Deprecated. Queries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects.
<T> QueryResultPage<T>
queryPage(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
          Deprecated. Queries an Amazon DynamoDB table and returns a single page of matching results.
<T> QueryResultPage<T>
queryPage(java.lang.Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
          Deprecated. Queries an Amazon DynamoDB table and returns a single page of matching results.
<T> void
save(T object)
          Deprecated. Saves the object given into DynamoDB, using the default configuration.
<T> void
save(T object, DynamoDBMapperConfig config)
          Deprecated. Saves the object given into DynamoDB, using the specified configuration.
<T> void
save(T object, DynamoDBSaveExpression saveExpression)
          Deprecated. Saves the object given into DynamoDB, using the default configuration and the specified saveExpression.
<T> void
save(T object, DynamoDBSaveExpression saveExpression, DynamoDBMapperConfig config)
          Deprecated. Saves an item in DynamoDB.
<T> PaginatedScanList<T>
scan(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression)
          Deprecated. Scans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.
<T> PaginatedScanList<T>
scan(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
          Deprecated. Scans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects.
<T> ScanResultPage<T>
scanPage(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression)
          Deprecated. Scans through an Amazon DynamoDB table and returns a single page of matching results.
<T> ScanResultPage<T>
scanPage(java.lang.Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
          Deprecated. Scans through an Amazon DynamoDB table and returns a single page of matching results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB dynamoDB)
Deprecated. 
Constructs a new mapper with the service object given, using the default configuration.

Parameters:
dynamoDB - The service object to use for all service calls.
See Also:
DynamoDBMapperConfig.DEFAULT

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB dynamoDB,
                      DynamoDBMapperConfig config)
Deprecated. 
Constructs a new mapper with the service object and configuration given.

Parameters:
dynamoDB - The service object to use for all service calls.
config - The default configuration to use for all service calls. It can be overridden on a per-operation basis.

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB ddb,
                      AWSCredentialsProvider s3CredentialProvider)
Deprecated. 
Constructs a new mapper with the service object and S3 client cache given, using the default configuration.

Parameters:
ddb - The service object to use for all service calls.
s3CredentialProvider - The credentials provider for accessing S3. Relevant only if S3Link is involved.
See Also:
DynamoDBMapperConfig.DEFAULT

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB dynamoDB,
                      DynamoDBMapperConfig config,
                      AttributeTransformer transformer)
Deprecated. 
Constructs a new mapper with the given service object, configuration, and transform hook.

Parameters:
dynamoDB - the service object to use for all service calls
config - the default configuration to use for all service calls. It can be overridden on a per-operation basis
transformer - The custom attribute transformer to invoke when serializing or deserializing an object.

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB dynamoDB,
                      DynamoDBMapperConfig config,
                      AWSCredentialsProvider s3CredentialProvider)
Deprecated. 
Constructs a new mapper with the service object, configuration, and S3 client cache given.

Parameters:
dynamoDB - The service object to use for all service calls.
config - The default configuration to use for all service calls. It can be overridden on a per-operation basis.
s3CredentialProvider - The credentials provider for accessing S3. Relevant only if S3Link is involved.

DynamoDBMapper

public DynamoDBMapper(AmazonDynamoDB dynamoDB,
                      DynamoDBMapperConfig config,
                      AttributeTransformer transformer,
                      AWSCredentialsProvider s3CredentialsProvider)
Deprecated. 
Constructor with all parameters.

Parameters:
dynamoDB - The service object to use for all service calls.
config - The default configuration to use for all service calls. It can be overridden on a per-operation basis.
transformer - The custom attribute transformer to invoke when serializing or deserializing an object.
s3CredentialProvider - The credentials provider for accessing S3. Relevant only if S3Link is involved.
Method Detail

load

public <T> T load(java.lang.Class<T> clazz,
                  java.lang.Object hashKey,
                  DynamoDBMapperConfig config)
Deprecated. 
Loads an object with the hash key given and a configuration override. This configuration overrides the default provided at object construction.

See Also:
load(Class, Object, Object, DynamoDBMapperConfig)

load

public <T> T load(java.lang.Class<T> clazz,
                  java.lang.Object hashKey)
Deprecated. 
Loads an object with the hash key given, using the default configuration.

See Also:
load(Class, Object, Object, DynamoDBMapperConfig)

load

public <T> T load(java.lang.Class<T> clazz,
                  java.lang.Object hashKey,
                  java.lang.Object rangeKey)
Deprecated. 
Loads an object with a hash and range key, using the default configuration.

See Also:
load(Class, Object, Object, DynamoDBMapperConfig)

load

public <T> T load(T keyObject)
Deprecated. 
Returns an object whose keys match those of the prototype key object given, or null if no such item exists.

Parameters:
keyObject - An object of the class to load with the keys values to match.
See Also:
load(Object, DynamoDBMapperConfig)

load

public <T> T load(T keyObject,
                  DynamoDBMapperConfig config)
Deprecated. 
Returns an object whose keys match those of the prototype key object given, or null if no such item exists.

Parameters:
keyObject - An object of the class to load with the keys values to match.
config - Configuration for the service call to retrieve the object from DynamoDB. This configuration overrides the default given at construction.

load

public <T> T load(java.lang.Class<T> clazz,
                  java.lang.Object hashKey,
                  java.lang.Object rangeKey,
                  DynamoDBMapperConfig config)
Deprecated. 
Returns an object with the given hash key, or null if no such object exists.

Parameters:
clazz - The class to load, corresponding to a DynamoDB table.
hashKey - The key of the object.
rangeKey - The range key of the object, or null for tables without a range key.
config - Configuration for the service call to retrieve the object from DynamoDB. This configuration overrides the default given at construction.

marshallIntoObject

@Deprecated
public <T> T marshallIntoObject(java.lang.Class<T> clazz,
                                           java.util.Map<java.lang.String,AttributeValue> itemAttributes)
Deprecated. as an extension point for adding custom unmarshalling

Creates and fills in the attributes on an instance of the class given with the attributes given.

This is accomplished by looking for getter methods annotated with an appropriate annotation, then looking for matching attribute names in the item attribute map.

This method has been marked deprecated because it does not allow load/query/scan to pass through their DynamoDBMapperConfig parameter, which is needed by some implementations of AttributeTransformer. In a future version of the SDK, load/query/scan will be changed to directly call privateMarshalIntoObject, and will no longer call this method.

If you are extending DynamoDBMapper and overriding this method to customize how the mapper unmarshals POJOs from a raw DynamoDB item, please switch to using an AttributeTransformer (or open a GitHub issue if you need to fully control the unmarshalling process, and we'll figure out a better way to expose such a hook).

If you're simply calling this method, it will continue to be available for the forseeable future - feel free to ignore the @Deprecated tag.

Parameters:
clazz - The class to instantiate and hydrate
itemAttributes - The set of item attributes, keyed by attribute name.

marshallIntoObjects

@Deprecated
public <T> java.util.List<T> marshallIntoObjects(java.lang.Class<T> clazz,
                                                            java.util.List<java.util.Map<java.lang.String,AttributeValue>> itemAttributes)
Deprecated. as an extension point for adding custom unmarshalling

Unmarshalls the list of item attributes into objects of type clazz.

This method has been marked deprecated because it does not allow query/scan to pass through their DynamoDBMapperConfig parameter, which is needed by some implementations of AttributeTransformer. In a future version of the SDK, query/scan will be changed to directly call privateMarshalIntoObjects, and will no longer call this method.

If you are extending DynamoDBMapper and overriding this method to customize how the mapper unmarshals POJOs from raw DynamoDB items, please switch to using an AttributeTransformer (or open a GitHub issue if you need to fully control the unmarshalling process, and we'll figure out a better way to expose such a hook).

If you're simply calling this method, it will continue to be available for the forseeable future - feel free to ignore the @Deprecated tag.

See Also:
marshallIntoObject(Class, Map)

save

public <T> void save(T object)
Deprecated. 
Saves the object given into DynamoDB, using the default configuration.

See Also:
save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)

save

public <T> void save(T object,
                     DynamoDBSaveExpression saveExpression)
Deprecated. 
Saves the object given into DynamoDB, using the default configuration and the specified saveExpression.

See Also:
save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)

save

public <T> void save(T object,
                     DynamoDBMapperConfig config)
Deprecated. 
Saves the object given into DynamoDB, using the specified configuration.

See Also:
save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)

save

public <T> void save(T object,
                     DynamoDBSaveExpression saveExpression,
                     DynamoDBMapperConfig config)
Deprecated. 
Saves an item in DynamoDB. The service method used is determined by the DynamoDBMapperConfig.getSaveBehavior() value, to use either AmazonDynamoDB.putItem(PutItemRequest) or AmazonDynamoDB.updateItem(UpdateItemRequest): Any options specified in the saveExpression parameter will be overlaid on any constraints due to versioned attributes.

Parameters:
object - The object to save into DynamoDB
saveExpression - The options to apply to this save request
config - The configuration to use, which overrides the default provided at object construction.
See Also:
DynamoDBMapperConfig.SaveBehavior

delete

public void delete(java.lang.Object object)
Deprecated. 
Deletes the given object from its DynamoDB table using the default configuration.


delete

public void delete(java.lang.Object object,
                   DynamoDBDeleteExpression deleteExpression)
Deprecated. 
Deletes the given object from its DynamoDB table using the specified deleteExpression and default configuration.


delete

public void delete(java.lang.Object object,
                   DynamoDBMapperConfig config)
Deprecated. 
Deletes the given object from its DynamoDB table using the specified configuration.


delete

public <T> void delete(T object,
                       DynamoDBDeleteExpression deleteExpression,
                       DynamoDBMapperConfig config)
Deprecated. 
Deletes the given object from its DynamoDB table using the provided deleteExpression and provided configuration. Any options specified in the deleteExpression parameter will be overlaid on any constraints due to versioned attributes.

Parameters:
deleteExpression - The options to apply to this delete request
config - Config override object. If DynamoDBMapperConfig.SaveBehavior.CLOBBER is supplied, version fields will not be considered when deleting the object.

batchDelete

public java.util.List<DynamoDBMapper.FailedBatch> batchDelete(java.util.List<? extends java.lang.Object> objectsToDelete)
Deprecated. 
Deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API. No version checks are performed, as required by the API.

See Also:
batchWrite(List, List, DynamoDBMapperConfig)

batchDelete

public java.util.List<DynamoDBMapper.FailedBatch> batchDelete(java.lang.Object... objectsToDelete)
Deprecated. 
Deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API. No version checks are performed, as required by the API.

See Also:
batchWrite(List, List, DynamoDBMapperConfig)

batchSave

public java.util.List<DynamoDBMapper.FailedBatch> batchSave(java.util.List<? extends java.lang.Object> objectsToSave)
Deprecated. 
Saves the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API. No version checks are performed, as required by the API.

This method ignores any SaveBehavior set on the mapper, and always behaves as if SaveBehavior.CLOBBER was specified, as the AmazonDynamoDB.batchWriteItem() request does not support updating existing items.

See Also:
batchWrite(List, List, DynamoDBMapperConfig)

batchSave

public java.util.List<DynamoDBMapper.FailedBatch> batchSave(java.lang.Object... objectsToSave)
Deprecated. 
Saves the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API. No version checks are performed, as required by the API.

This method ignores any SaveBehavior set on the mapper, and always behaves as if SaveBehavior.CLOBBER was specified, as the AmazonDynamoDB.batchWriteItem() request does not support updating existing items.

See Also:
batchWrite(List, List, DynamoDBMapperConfig)

batchWrite

public java.util.List<DynamoDBMapper.FailedBatch> batchWrite(java.util.List<? extends java.lang.Object> objectsToWrite,
                                                             java.util.List<? extends java.lang.Object> objectsToDelete)
Deprecated. 
Saves and deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API. No version checks are performed, as required by the API.

This method ignores any SaveBehavior set on the mapper, and always behaves as if SaveBehavior.CLOBBER was specified, as the AmazonDynamoDB.batchWriteItem() request does not support updating existing items.

See Also:
batchWrite(List, List, DynamoDBMapperConfig)

batchWrite

public java.util.List<DynamoDBMapper.FailedBatch> batchWrite(java.util.List<? extends java.lang.Object> objectsToWrite,
                                                             java.util.List<? extends java.lang.Object> objectsToDelete,
                                                             DynamoDBMapperConfig config)
Deprecated. 
Saves and deletes the objects given using one or more calls to the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.

Parameters:
objectsToWrite - A list of objects to save to DynamoDB. No version checks are performed, as required by the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
objectsToDelete - A list of objects to delete from DynamoDB. No version checks are performed, as required by the AmazonDynamoDB.batchWriteItem(BatchWriteItemRequest) API.
config - Only DynamoDBMapperConfig.getTableNameOverride() is considered; if specified, all objects in the two parameter lists will be considered to belong to the given table override. In particular, this method always acts as if SaveBehavior.CLOBBER was specified regardless of the value of the config parameter.
Returns:
A list of failed batches which includes the unprocessed items and the exceptions causing the failure.

batchLoad

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.List<java.lang.Object> itemsToGet)
Deprecated. 
Retrieves multiple items from multiple tables using their primary keys.

Returns:
A map of the loaded objects. Each key in the map is the name of a DynamoDB table. Each value in the map is a list of objects that have been loaded from that table. All objects for each table can be cast to the associated user defined type that is annotated as mapping that table.
See Also:
batchLoad(List, DynamoDBMapperConfig)

batchLoad

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.List<java.lang.Object> itemsToGet,
                                                                                  DynamoDBMapperConfig config)
Deprecated. 
Retrieves multiple items from multiple tables using their primary keys.

Parameters:
itemsToGet - Key objects, corresponding to the class to fetch, with their primary key values set.
config - Only DynamoDBMapperConfig.getTableNameOverride() and DynamoDBMapperConfig.getConsistentReads() are considered.
Returns:
A map of the loaded objects. Each key in the map is the name of a DynamoDB table. Each value in the map is a list of objects that have been loaded from that table. All objects for each table can be cast to the associated user defined type that is annotated as mapping that table.

batchLoad

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.Map<java.lang.Class<?>,java.util.List<KeyPair>> itemsToGet)
Deprecated. 
Retrieves the attributes for multiple items from multiple tables using their primary keys. AmazonDynamoDB.batchGetItem(BatchGetItemRequest) API.

Returns:
A map of the loaded objects. Each key in the map is the name of a DynamoDB table. Each value in the map is a list of objects that have been loaded from that table. All objects for each table can be cast to the associated user defined type that is annotated as mapping that table.
See Also:
batchLoad(List, DynamoDBMapperConfig), batchLoad(Map, DynamoDBMapperConfig)

batchLoad

public java.util.Map<java.lang.String,java.util.List<java.lang.Object>> batchLoad(java.util.Map<java.lang.Class<?>,java.util.List<KeyPair>> itemsToGet,
                                                                                  DynamoDBMapperConfig config)
Deprecated. 
Retrieves multiple items from multiple tables using their primary keys. Valid only for tables with a single hash key, or a single hash and range key. For other schemas, use batchLoad(List, DynamoDBMapperConfig)

Parameters:
itemsToGet - Map from class to load to list of primary key attributes.
config - Only DynamoDBMapperConfig.getTableNameOverride() and DynamoDBMapperConfig.getConsistentReads() are considered.
Returns:
A map of the loaded objects. Each key in the map is the name of a DynamoDB table. Each value in the map is a list of objects that have been loaded from that table. All objects for each table can be cast to the associated user defined type that is annotated as mapping that table.

scan

public <T> PaginatedScanList<T> scan(java.lang.Class<T> clazz,
                                     DynamoDBScanExpression scanExpression)
Deprecated. 
Scans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.

See Also:
scan(Class, DynamoDBScanExpression, DynamoDBMapperConfig)

scan

public <T> PaginatedScanList<T> scan(java.lang.Class<T> clazz,
                                     DynamoDBScanExpression scanExpression,
                                     DynamoDBMapperConfig config)
Deprecated. 
Scans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects. The table to scan is determined by looking at the annotations on the specified class, which declares where to store the object data in Amazon DynamoDB, and the scan expression parameter allows the caller to filter results and control how the scan is executed.

Callers should be aware that the returned list is unmodifiable, and any attempts to modify the list will result in an UnsupportedOperationException.

You can specify the pagination loading strategy for this scan operation. By default, the list returned is lazily loaded when possible.

Type Parameters:
T - The type of the objects being returned.
Parameters:
clazz - The class annotated with DynamoDB annotations describing how to store the object data in Amazon DynamoDB.
scanExpression - Details on how to run the scan, including any filters to apply to limit results.
config - The configuration to use for this scan, which overrides the default provided at object construction.
Returns:
An unmodifiable list of the objects constructed from the results of the scan operation.
See Also:
PaginatedScanList, DynamoDBMapperConfig.PaginationLoadingStrategy

parallelScan

public <T> PaginatedParallelScanList<T> parallelScan(java.lang.Class<T> clazz,
                                                     DynamoDBScanExpression scanExpression,
                                                     int totalSegments)
Deprecated. 
Scans through an Amazon DynamoDB table on logically partitioned segments in parallel and returns the matching results in one unmodifiable list of instantiated objects, using the default configuration.

See Also:
parallelScan(Class, DynamoDBScanExpression,int, DynamoDBMapperConfig)

parallelScan

public <T> PaginatedParallelScanList<T> parallelScan(java.lang.Class<T> clazz,
                                                     DynamoDBScanExpression scanExpression,
                                                     int totalSegments,
                                                     DynamoDBMapperConfig config)
Deprecated. 
Scans through an Amazon DynamoDB table on logically partitioned segments in parallel. This method will create a thread pool of the specified size, and each thread will issue scan requests for its assigned segment, following the returned continuation token, until the end of its segment. Callers should be responsible for setting the appropriate number of total segments. More scan segments would result in better performance but more consumed capacity of the table. The results are returned in one unmodifiable list of instantiated objects. The table to scan is determined by looking at the annotations on the specified class, which declares where to store the object data in Amazon DynamoDB, and the scan expression parameter allows the caller to filter results and control how the scan is executed.

Callers should be aware that the returned list is unmodifiable, and any attempts to modify the list will result in an UnsupportedOperationException.

You can specify the pagination loading strategy for this parallel scan operation. By default, the list returned is lazily loaded when possible.

Type Parameters:
T - The type of the objects being returned.
Parameters:
clazz - The class annotated with DynamoDB annotations describing how to store the object data in Amazon DynamoDB.
scanExpression - Details on how to run the scan, including any filters to apply to limit results.
totalSegments - Number of total parallel scan segments. Range: 1 - 4096
config - The configuration to use for this scan, which overrides the default provided at object construction.
Returns:
An unmodifiable list of the objects constructed from the results of the scan operation.
See Also:
PaginatedParallelScanList, DynamoDBMapperConfig.PaginationLoadingStrategy

scanPage

public <T> ScanResultPage<T> scanPage(java.lang.Class<T> clazz,
                                      DynamoDBScanExpression scanExpression,
                                      DynamoDBMapperConfig config)
Deprecated. 
Scans through an Amazon DynamoDB table and returns a single page of matching results. The table to scan is determined by looking at the annotations on the specified class, which declares where to store the object data in AWS DynamoDB, and the scan expression parameter allows the caller to filter results and control how the scan is executed.

Type Parameters:
T - The type of the objects being returned.
Parameters:
clazz - The class annotated with DynamoDB annotations describing how to store the object data in Amazon DynamoDB.
scanExpression - Details on how to run the scan, including any filters to apply to limit results.
config - The configuration to use for this scan, which overrides the default provided at object construction.

scanPage

public <T> ScanResultPage<T> scanPage(java.lang.Class<T> clazz,
                                      DynamoDBScanExpression scanExpression)
Deprecated. 
Scans through an Amazon DynamoDB table and returns a single page of matching results.

See Also:
scanPage(Class, DynamoDBScanExpression, DynamoDBMapperConfig)

query

public <T> PaginatedQueryList<T> query(java.lang.Class<T> clazz,
                                       DynamoDBQueryExpression<T> queryExpression)
Deprecated. 
Queries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.

See Also:
query(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)

query

public <T> PaginatedQueryList<T> query(java.lang.Class<T> clazz,
                                       DynamoDBQueryExpression<T> queryExpression,
                                       DynamoDBMapperConfig config)
Deprecated. 
Queries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects. The table to query is determined by looking at the annotations on the specified class, which declares where to store the object data in Amazon DynamoDB, and the query expression parameter allows the caller to filter results and control how the query is executed.

When the query is on any local/global secondary index, callers should be aware that the returned object(s) will only contain item attributes that are projected into the index. All the other unprojected attributes will be saved as type default values.

Callers should also be aware that the returned list is unmodifiable, and any attempts to modify the list will result in an UnsupportedOperationException.

You can specify the pagination loading strategy for this query operation. By default, the list returned is lazily loaded when possible.

Type Parameters:
T - The type of the objects being returned.
Parameters:
clazz - The class annotated with DynamoDB annotations describing how to store the object data in Amazon DynamoDB.
queryExpression - Details on how to run the query, including any conditions on the key values
config - The configuration to use for this query, which overrides the default provided at object construction.
Returns:
An unmodifiable list of the objects constructed from the results of the query operation.
See Also:
PaginatedQueryList, DynamoDBMapperConfig.PaginationLoadingStrategy

queryPage

public <T> QueryResultPage<T> queryPage(java.lang.Class<T> clazz,
                                        DynamoDBQueryExpression<T> queryExpression)
Deprecated. 
Queries an Amazon DynamoDB table and returns a single page of matching results. The table to query is determined by looking at the annotations on the specified class, which declares where to store the object data in Amazon DynamoDB, and the query expression parameter allows the caller to filter results and control how the query is executed.

See Also:
queryPage(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)

queryPage

public <T> QueryResultPage<T> queryPage(java.lang.Class<T> clazz,
                                        DynamoDBQueryExpression<T> queryExpression,
                                        DynamoDBMapperConfig config)
Deprecated. 
Queries an Amazon DynamoDB table and returns a single page of matching results. The table to query is determined by looking at the annotations on the specified class, which declares where to store the object data in Amazon DynamoDB, and the query expression parameter allows the caller to filter results and control how the query is executed.

Type Parameters:
T - The type of the objects being returned.
Parameters:
clazz - The class annotated with DynamoDB annotations describing how to store the object data in AWS DynamoDB.
queryExpression - Details on how to run the query, including any conditions on the key values
config - The configuration to use for this query, which overrides the default provided at object construction.

count

public int count(java.lang.Class<?> clazz,
                 DynamoDBScanExpression scanExpression)
Deprecated. 
Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.

See Also:
count(Class, DynamoDBScanExpression, DynamoDBMapperConfig)

count

public int count(java.lang.Class<?> clazz,
                 DynamoDBScanExpression scanExpression,
                 DynamoDBMapperConfig config)
Deprecated. 
Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data.

This operation will scan your entire table, and can therefore be very expensive. Use with caution.

Parameters:
clazz - The class mapped to a DynamoDB table.
scanExpression - The parameters for running the scan.
config - The configuration to use for this scan, which overrides the default provided at object construction.
Returns:
The count of matching items, without returning any of the actual item data.

count

public <T> int count(java.lang.Class<T> clazz,
                     DynamoDBQueryExpression<T> queryExpression)
Deprecated. 
Evaluates the specified query expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.

See Also:
count(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)

count

public <T> int count(java.lang.Class<T> clazz,
                     DynamoDBQueryExpression<T> queryExpression,
                     DynamoDBMapperConfig config)
Deprecated. 
Evaluates the specified query expression and returns the count of matching items, without returning any of the actual item data.

Parameters:
clazz - The class mapped to a DynamoDB table.
queryExpression - The parameters for running the scan.
config - The mapper configuration to use for the query, which overrides the default provided at object construction.
Returns:
The count of matching items, without returning any of the actual item data.

getS3ClientCache

public S3ClientCache getS3ClientCache()
Deprecated. 
Returns the underlying S3ClientCache for accessing S3.


createS3Link

public S3Link createS3Link(java.lang.String bucketName,
                           java.lang.String key)
Deprecated. 
Creates an S3Link with the specified bucket name and key using the default S3 region. This method requires the mapper to have been initialized with the necessary credentials for accessing S3.

Throws:
java.lang.IllegalStateException - if the mapper has not been constructed with the necessary S3 AWS credentials.

createS3Link

public S3Link createS3Link(Region s3region,
                           java.lang.String bucketName,
                           java.lang.String key)
Deprecated. 
Creates an S3Link with the specified region, bucket name and key. This method requires the mapper to have been initialized with the necessary credentials for accessing S3.

Throws:
java.lang.IllegalStateException - if the mapper has not been constructed with the necessary S3 AWS credentials.

generateCreateTableRequest

public CreateTableRequest generateCreateTableRequest(java.lang.Class<?> clazz)
Deprecated. 
Parse the given POJO class and return the CreateTableRequest for the DynamoDB table it represents. Note that the returned request does not include the required ProvisionedThroughput parameters for the primary table and the GSIs, and that all secondary indexes are initialized with the default projection type - KEY_ONLY.



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