Class AbstractDynamoDBMapper
- java.lang.Object
-
- com.amazonaws.services.dynamodbv2.datamodeling.AbstractDynamoDBMapper
-
- All Implemented Interfaces:
IDynamoDBMapper
- Direct Known Subclasses:
DynamoDBMapper
public class AbstractDynamoDBMapper extends Object implements IDynamoDBMapper
Abstract implementation ofIDynamoDBMapper. Convenient method forms pass through to the corresponding overload that takes a request object, which throws anUnsupportedOperationException.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDynamoDBMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DynamoDBMapper.FailedBatch>batchDelete(Iterable<? extends Object> objectsToDelete)Deletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.List<DynamoDBMapper.FailedBatch>batchDelete(Object... objectsToDelete)Deletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.Map<String,List<Object>>batchLoad(Iterable<? extends Object> itemsToGet)Retrieves multiple items from multiple tables using their primary keys.Map<String,List<Object>>batchLoad(Iterable<? extends Object> itemsToGet, DynamoDBMapperConfig config)Retrieves multiple items from multiple tables using their primary keys.Map<String,List<Object>>batchLoad(Map<Class<?>,List<KeyPair>> itemsToGet)Retrieves the attributes for multiple items from multiple tables using their primary keys.Map<String,List<Object>>batchLoad(Map<Class<?>,List<KeyPair>> itemsToGet, DynamoDBMapperConfig config)Retrieves multiple items from multiple tables using their primary keys.List<DynamoDBMapper.FailedBatch>batchSave(Iterable<? extends Object> objectsToSave)Saves the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.List<DynamoDBMapper.FailedBatch>batchSave(Object... objectsToSave)Saves the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.List<DynamoDBMapper.FailedBatch>batchWrite(Iterable<? extends Object> objectsToWrite, Iterable<? extends Object> objectsToDelete)Saves and deletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.List<DynamoDBMapper.FailedBatch>batchWrite(Iterable<? extends Object> objectsToWrite, Iterable<? extends Object> objectsToDelete, DynamoDBMapperConfig config)Saves and deletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.intcount(Class<?> clazz, DynamoDBScanExpression scanExpression)Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.intcount(Class<?> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)Evaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data.<T> intcount(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)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> intcount(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)Evaluates the specified query expression and returns the count of matching items, without returning any of the actual item data.S3LinkcreateS3Link(Region s3region, String bucketName, String key)Creates an S3Link with the specified region, bucket name and key.S3LinkcreateS3Link(String bucketName, String key)Creates an S3Link with the specified bucket name and key using the default S3 region.voiddelete(Object object)Deletes the given object from its DynamoDB table using the default configuration.voiddelete(Object object, DynamoDBDeleteExpression deleteExpression)Deletes the given object from its DynamoDB table using the specified deleteExpression and default configuration.voiddelete(Object object, DynamoDBMapperConfig config)Deletes the given object from its DynamoDB table using the specified configuration.<T> voiddelete(T object, DynamoDBDeleteExpression deleteExpression, DynamoDBMapperConfig config)Deletes the given object from its DynamoDB table using the provided deleteExpression and provided configuration.CreateTableRequestgenerateCreateTableRequest(Class<?> clazz)Parse the given POJO class and return the CreateTableRequest for the DynamoDB table it represents.DeleteTableRequestgenerateDeleteTableRequest(Class<?> clazz)Parse the given POJO class and return the DeleteTableRequest for the DynamoDB table it represents.S3ClientCachegetS3ClientCache()Returns the underlyingS3ClientCachefor accessing S3.<T> Tload(Class<T> clazz, Object hashKey)Loads an object with the hash key given, using the default configuration.<T> Tload(Class<T> clazz, Object hashKey, DynamoDBMapperConfig config)Loads an object with the hash key given and a configuration override.<T> Tload(Class<T> clazz, Object hashKey, Object rangeKey)Loads an object with a hash and range key, using the default configuration.<T> Tload(Class<T> clazz, Object hashKey, Object rangeKey, DynamoDBMapperConfig config)Returns an object with the given hash key, or null if no such object exists.<T> Tload(T keyObject)Returns an object whose keys match those of the prototype key object given, or null if no such item exists.<T> Tload(T keyObject, DynamoDBMapperConfig config)Returns an object whose keys match those of the prototype key object given, or null if no such item exists.<T> TmarshallIntoObject(Class<T> clazz, Map<String,AttributeValue> itemAttributes)Creates and fills in the attributes on an instance of the class given with the attributes given.<T> List<T>marshallIntoObjects(Class<T> clazz, List<Map<String,AttributeValue>> itemAttributes)Unmarshalls the list of item attributes into objects of type clazz.<T> PaginatedParallelScanList<T>parallelScan(Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments)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(Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments, DynamoDBMapperConfig config)Scans through an Amazon DynamoDB table on logically partitioned segments in parallel.<T> PaginatedQueryList<T>query(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)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(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)Queries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects.<T> QueryResultPage<T>queryPage(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)Queries an Amazon DynamoDB table and returns a single page of matching results.<T> QueryResultPage<T>queryPage(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)Queries an Amazon DynamoDB table and returns a single page of matching results.<T> voidsave(T object)Saves the object given into DynamoDB, using the default configuration.<T> voidsave(T object, DynamoDBMapperConfig config)Saves the object given into DynamoDB, using the specified configuration.<T> voidsave(T object, DynamoDBSaveExpression saveExpression)Saves the object given into DynamoDB, using the default configuration and the specified saveExpression.<T> voidsave(T object, DynamoDBSaveExpression saveExpression, DynamoDBMapperConfig config)Saves an item in DynamoDB.<T> PaginatedScanList<T>scan(Class<T> clazz, DynamoDBScanExpression scanExpression)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(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)Scans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects.<T> ScanResultPage<T>scanPage(Class<T> clazz, DynamoDBScanExpression scanExpression)Scans through an Amazon DynamoDB table and returns a single page of matching results.<T> ScanResultPage<T>scanPage(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)Scans through an Amazon DynamoDB table and returns a single page of matching results.
-
-
-
Method Detail
-
load
public <T> T load(Class<T> clazz, Object hashKey, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperLoads an object with the hash key given and a configuration override. This configuration overrides the default provided at object construction.- Specified by:
loadin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.load(Class, Object, Object, DynamoDBMapperConfig)
-
load
public <T> T load(Class<T> clazz, Object hashKey)
Description copied from interface:IDynamoDBMapperLoads an object with the hash key given, using the default configuration.- Specified by:
loadin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.load(Class, Object, Object, DynamoDBMapperConfig)
-
load
public <T> T load(Class<T> clazz, Object hashKey, Object rangeKey)
Description copied from interface:IDynamoDBMapperLoads an object with a hash and range key, using the default configuration.- Specified by:
loadin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.load(Class, Object, Object, DynamoDBMapperConfig)
-
load
public <T> T load(T keyObject)
Description copied from interface:IDynamoDBMapperReturns an object whose keys match those of the prototype key object given, or null if no such item exists.- Specified by:
loadin interfaceIDynamoDBMapper- Parameters:
keyObject- An object of the class to load with the keys values to match.- See Also:
DynamoDBMapper.load(Object, DynamoDBMapperConfig)
-
load
public <T> T load(T keyObject, DynamoDBMapperConfig config)Description copied from interface:IDynamoDBMapperReturns an object whose keys match those of the prototype key object given, or null if no such item exists.- Specified by:
loadin interfaceIDynamoDBMapper- 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(Class<T> clazz, Object hashKey, Object rangeKey, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperReturns an object with the given hash key, or null if no such object exists.- Specified by:
loadin interfaceIDynamoDBMapper- 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
public <T> T marshallIntoObject(Class<T> clazz, Map<String,AttributeValue> itemAttributes)
Description copied from interface:IDynamoDBMapperCreates 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 is no longer called by load/scan/query methods. If you are overriding this method, please switch to using an AttributeTransformer
- Specified by:
marshallIntoObjectin interfaceIDynamoDBMapper- Parameters:
clazz- The class to instantiate and hydrateitemAttributes- The set of item attributes, keyed by attribute name.
-
marshallIntoObjects
public <T> List<T> marshallIntoObjects(Class<T> clazz, List<Map<String,AttributeValue>> itemAttributes)
Description copied from interface:IDynamoDBMapperUnmarshalls the list of item attributes into objects of type clazz.This method is no longer called by load/scan/query methods. If you are overriding this method, please switch to using an AttributeTransformer
- Specified by:
marshallIntoObjectsin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.marshallIntoObject(Class, Map)
-
save
public <T> void save(T object)
Description copied from interface:IDynamoDBMapperSaves the object given into DynamoDB, using the default configuration.- Specified by:
savein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)
-
save
public <T> void save(T object, DynamoDBSaveExpression saveExpression)Description copied from interface:IDynamoDBMapperSaves the object given into DynamoDB, using the default configuration and the specified saveExpression.- Specified by:
savein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)
-
save
public <T> void save(T object, DynamoDBMapperConfig config)Description copied from interface:IDynamoDBMapperSaves the object given into DynamoDB, using the specified configuration.- Specified by:
savein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.save(Object, DynamoDBSaveExpression, DynamoDBMapperConfig)
-
save
public <T> void save(T object, DynamoDBSaveExpression saveExpression, DynamoDBMapperConfig config)Description copied from interface:IDynamoDBMapperSaves an item in DynamoDB. The service method used is determined by theDynamoDBMapperConfig.getSaveBehavior()value, to use eitherAmazonDynamoDB.putItem(PutItemRequest)orAmazonDynamoDB.updateItem(UpdateItemRequest):- UPDATE (default) : 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.
- UPDATE_SKIP_NULL_ATTRIBUTES : 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 : CLOBBER will clear and replace all attributes, included unmodeled ones, (delete and recreate) on save. Versioned field constraints will also be disregarded.
- Specified by:
savein interfaceIDynamoDBMapper- Parameters:
object- The object to save into DynamoDBsaveExpression- The options to apply to this save requestconfig- The configuration to use, which overrides the default provided at object construction.- See Also:
DynamoDBMapperConfig.SaveBehavior
-
delete
public void delete(Object object)
Description copied from interface:IDynamoDBMapperDeletes the given object from its DynamoDB table using the default configuration.- Specified by:
deletein interfaceIDynamoDBMapper
-
delete
public void delete(Object object, DynamoDBDeleteExpression deleteExpression)
Description copied from interface:IDynamoDBMapperDeletes the given object from its DynamoDB table using the specified deleteExpression and default configuration.- Specified by:
deletein interfaceIDynamoDBMapper
-
delete
public void delete(Object object, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperDeletes the given object from its DynamoDB table using the specified configuration.- Specified by:
deletein interfaceIDynamoDBMapper
-
delete
public <T> void delete(T object, DynamoDBDeleteExpression deleteExpression, DynamoDBMapperConfig config)Description copied from interface:IDynamoDBMapperDeletes 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.- Specified by:
deletein interfaceIDynamoDBMapperdeleteExpression- The options to apply to this delete requestconfig- Config override object. IfDynamoDBMapperConfig.SaveBehavior.CLOBBERis supplied, version fields will not be considered when deleting the object.
-
batchDelete
public List<DynamoDBMapper.FailedBatch> batchDelete(Iterable<? extends Object> objectsToDelete)
Description copied from interface:IDynamoDBMapperDeletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API. No version checks are performed, as required by the API.- Specified by:
batchDeletein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.batchWrite(Iterable, Iterable)
-
batchDelete
public List<DynamoDBMapper.FailedBatch> batchDelete(Object... objectsToDelete)
Description copied from interface:IDynamoDBMapperDeletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API. No version checks are performed, as required by the API.- Specified by:
batchDeletein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.batchWrite(Iterable, Iterable)
-
batchSave
public List<DynamoDBMapper.FailedBatch> batchSave(Iterable<? extends Object> objectsToSave)
Description copied from interface:IDynamoDBMapperSaves the objects given using one or more calls to theAmazonDynamoDB.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.This method fails to save the batch if the size of an individual object in the batch exceeds 400 KB. For more information on batch restrictions see, http://docs.aws.amazon .com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
- Specified by:
batchSavein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.batchWrite(Iterable, Iterable)
-
batchSave
public List<DynamoDBMapper.FailedBatch> batchSave(Object... objectsToSave)
Description copied from interface:IDynamoDBMapperSaves the objects given using one or more calls to theAmazonDynamoDB.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. *This method fails to save the batch if the size of an individual object in the batch exceeds 400 KB. For more information on batch restrictions see, http://docs.aws.amazon .com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
- Specified by:
batchSavein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.batchWrite(Iterable, Iterable)
-
batchWrite
public List<DynamoDBMapper.FailedBatch> batchWrite(Iterable<? extends Object> objectsToWrite, Iterable<? extends Object> objectsToDelete)
Description copied from interface:IDynamoDBMapperSaves and deletes the objects given using one or more calls to theAmazonDynamoDB.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.This method fails to save the batch if the size of an individual object in the batch exceeds 400 KB. For more information on batch restrictions see, http://docs.aws.amazon .com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
If one of the write requests is for a table that is not present, this method does not throw a ResourceNotFoundException but returns a FailedBatch which includes this exception and the unprocessed items.
- Specified by:
batchWritein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.batchWrite(Iterable, Iterable)
-
batchWrite
public List<DynamoDBMapper.FailedBatch> batchWrite(Iterable<? extends Object> objectsToWrite, Iterable<? extends Object> objectsToDelete, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperSaves and deletes the objects given using one or more calls to theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API. Use mapper config to control the retry strategy when UnprocessedItems are returned by the BatchWriteItem APIThis method fails to save the batch if the size of an individual object in the batch exceeds 400 KB. For more information on batch restrictions see, http://docs.aws.amazon .com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
If one of the write requests is for a table that is not present, this method does not throw a ResourceNotFoundException but returns a FailedBatch which includes this exception and the unprocessed items.
- Specified by:
batchWritein interfaceIDynamoDBMapper- Parameters:
objectsToWrite- A list of objects to save to DynamoDB. No version checks are performed, as required by theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.objectsToDelete- A list of objects to delete from DynamoDB. No version checks are performed, as required by theAmazonDynamoDB.batchWriteItem(BatchWriteItemRequest)API.config- OnlyDynamoDBMapperConfig.getTableNameOverride()andDynamoDBMapperConfig.getBatchWriteRetryStrategy()are considered. If TableNameOverride is 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.
- See Also:
DynamoDBMapperConfig.getTableNameOverride(),DynamoDBMapperConfig.getBatchWriteRetryStrategy()
-
batchLoad
public Map<String,List<Object>> batchLoad(Iterable<? extends Object> itemsToGet)
Description copied from interface:IDynamoDBMapperRetrieves multiple items from multiple tables using their primary keys.- Specified by:
batchLoadin interfaceIDynamoDBMapper- 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:
DynamoDBMapper#batchLoad(List, DynamoDBMapperConfig)
-
batchLoad
public Map<String,List<Object>> batchLoad(Iterable<? extends Object> itemsToGet, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperRetrieves multiple items from multiple tables using their primary keys.- Specified by:
batchLoadin interfaceIDynamoDBMapper- Parameters:
itemsToGet- Key objects, corresponding to the class to fetch, with their primary key values set.config- OnlyDynamoDBMapperConfig.getTableNameOverride()andDynamoDBMapperConfig.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 Map<String,List<Object>> batchLoad(Map<Class<?>,List<KeyPair>> itemsToGet)
Description copied from interface:IDynamoDBMapperRetrieves the attributes for multiple items from multiple tables using their primary keys.AmazonDynamoDB.batchGetItem(BatchGetItemRequest)API.- Specified by:
batchLoadin interfaceIDynamoDBMapper- 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),IDynamoDBMapper.batchLoad(Map, DynamoDBMapperConfig)
-
batchLoad
public Map<String,List<Object>> batchLoad(Map<Class<?>,List<KeyPair>> itemsToGet, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperRetrieves 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, useDynamoDBMapper#batchLoad(List, DynamoDBMapperConfig)- Specified by:
batchLoadin interfaceIDynamoDBMapper- Parameters:
itemsToGet- Map from class to load to list of primary key attributes.config- OnlyDynamoDBMapperConfig.getTableNameOverride()andDynamoDBMapperConfig.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(Class<T> clazz, DynamoDBScanExpression scanExpression)
Description copied from interface:IDynamoDBMapperScans through an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.- Specified by:
scanin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.scan(Class, DynamoDBScanExpression, DynamoDBMapperConfig)
-
scan
public <T> PaginatedScanList<T> scan(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperScans 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.
- Specified by:
scanin interfaceIDynamoDBMapper- 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(Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments)
Description copied from interface:IDynamoDBMapperScans 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.- Specified by:
parallelScanin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.parallelScan(Class, DynamoDBScanExpression,int, DynamoDBMapperConfig)
-
parallelScan
public <T> PaginatedParallelScanList<T> parallelScan(Class<T> clazz, DynamoDBScanExpression scanExpression, int totalSegments, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperScans 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.
- Specified by:
parallelScanin interfaceIDynamoDBMapper- 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 - 4096config- 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(Class<T> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperScans 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.- Specified by:
scanPagein interfaceIDynamoDBMapper- 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(Class<T> clazz, DynamoDBScanExpression scanExpression)
Description copied from interface:IDynamoDBMapperScans through an Amazon DynamoDB table and returns a single page of matching results.- Specified by:
scanPagein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.scanPage(Class, DynamoDBScanExpression, DynamoDBMapperConfig)
-
query
public <T> PaginatedQueryList<T> query(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
Description copied from interface:IDynamoDBMapperQueries an Amazon DynamoDB table and returns the matching results as an unmodifiable list of instantiated objects, using the default configuration.- Specified by:
queryin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.query(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)
-
query
public <T> PaginatedQueryList<T> query(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperQueries 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.
- Specified by:
queryin interfaceIDynamoDBMapper- 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 valuesconfig- 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(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
Description copied from interface:IDynamoDBMapperQueries 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.- Specified by:
queryPagein interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.queryPage(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)
-
queryPage
public <T> QueryResultPage<T> queryPage(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperQueries 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.- Specified by:
queryPagein interfaceIDynamoDBMapper- 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 valuesconfig- The configuration to use for this query, which overrides the default provided at object construction.
-
count
public int count(Class<?> clazz, DynamoDBScanExpression scanExpression)
Description copied from interface:IDynamoDBMapperEvaluates the specified scan expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.- Specified by:
countin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.count(Class, DynamoDBScanExpression, DynamoDBMapperConfig)
-
count
public int count(Class<?> clazz, DynamoDBScanExpression scanExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperEvaluates 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.
- Specified by:
countin interfaceIDynamoDBMapper- 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(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression)
Description copied from interface:IDynamoDBMapperEvaluates the specified query expression and returns the count of matching items, without returning any of the actual item data, using the default configuration.- Specified by:
countin interfaceIDynamoDBMapper- See Also:
DynamoDBMapper.count(Class, DynamoDBQueryExpression, DynamoDBMapperConfig)
-
count
public <T> int count(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression, DynamoDBMapperConfig config)
Description copied from interface:IDynamoDBMapperEvaluates the specified query expression and returns the count of matching items, without returning any of the actual item data.- Specified by:
countin interfaceIDynamoDBMapper- 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()
Description copied from interface:IDynamoDBMapperReturns the underlyingS3ClientCachefor accessing S3.- Specified by:
getS3ClientCachein interfaceIDynamoDBMapper
-
createS3Link
public S3Link createS3Link(String bucketName, String key)
Description copied from interface:IDynamoDBMapperCreates 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.- Specified by:
createS3Linkin interfaceIDynamoDBMapper
-
createS3Link
public S3Link createS3Link(Region s3region, String bucketName, String key)
Description copied from interface:IDynamoDBMapperCreates 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.- Specified by:
createS3Linkin interfaceIDynamoDBMapper
-
generateCreateTableRequest
public CreateTableRequest generateCreateTableRequest(Class<?> clazz)
Description copied from interface:IDynamoDBMapperParse 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.- Specified by:
generateCreateTableRequestin interfaceIDynamoDBMapper
-
generateDeleteTableRequest
public DeleteTableRequest generateDeleteTableRequest(Class<?> clazz)
Description copied from interface:IDynamoDBMapperParse the given POJO class and return the DeleteTableRequest for the DynamoDB table it represents.- Specified by:
generateDeleteTableRequestin interfaceIDynamoDBMapper
-
-