DynamoDBOperations
, org.springframework.beans.factory.Aware
, org.springframework.context.ApplicationContextAware
public class DynamoDBTemplate extends Object implements DynamoDBOperations, org.springframework.context.ApplicationContextAware
Constructor | Description |
---|---|
DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB) |
Convenient construcotr to thse the
DynamoDBMapperConfig.DEFAULT and
default DynamoDBMapper(AmazonDynamoDB) |
DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper dynamoDBMapper) |
Convenient constructor to use the
DynamoDBMapperConfig.DEFAULT |
DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig dynamoDBMapperConfig) |
Convenient constructor to use the default
DynamoDBMapper(AmazonDynamoDB) |
DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig dynamoDBMapperConfig,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper dynamoDBMapper) |
Initializes a new
DynamoDBTemplate . |
Modifier and Type | Method | Description |
---|---|---|
List<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch> |
batchDelete(Iterable<?> entities) |
|
<T> List<T> |
batchLoad(Map<Class<?>,List<com.amazonaws.services.dynamodbv2.datamodeling.KeyPair>> itemsToGet) |
|
List<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch> |
batchSave(Iterable<?> entities) |
|
<T> int |
count(Class<T> domainClass,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression) |
|
<T> int |
count(Class<T> domainClass,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression scanExpression) |
|
<T> int |
count(Class<T> clazz,
com.amazonaws.services.dynamodbv2.model.QueryRequest mutableQueryRequest) |
|
<T> T |
delete(T entity) |
|
<T> String |
getOverriddenTableName(Class<T> domainClass,
String tableName) |
|
<T> com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperTableModel<T> |
getTableModel(Class<T> domainClass) |
Provides access to the DynamoDB mapper table model of the underlying domain
type.
|
<T> T |
load(Class<T> domainClass,
Object hashKey) |
|
<T> T |
load(Class<T> domainClass,
Object hashKey,
Object rangeKey) |
|
protected <T> void |
maybeEmitEvent(T source,
Function<T,DynamoDBMappingEvent<T>> factory) |
|
<T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList<T> |
query(Class<T> domainClass,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression) |
|
<T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList<T> |
query(Class<T> clazz,
com.amazonaws.services.dynamodbv2.model.QueryRequest queryRequest) |
|
<T> T |
save(T entity) |
|
<T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedScanList<T> |
scan(Class<T> domainClass,
com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression scanExpression) |
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig dynamoDBMapperConfig)
DynamoDBMapper(AmazonDynamoDB)
amazonDynamoDB
- The AWS SDK instance to talk to DynamoDBdynamoDBMapperConfig
- The config to usepublic DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper dynamoDBMapper)
DynamoDBMapperConfig.DEFAULT
amazonDynamoDB
- The AWS SDK instance to talk to DynamoDBdynamoDBMapper
- The Mapper to usepublic DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB)
DynamoDBMapperConfig.DEFAULT
and
default DynamoDBMapper(AmazonDynamoDB)
amazonDynamoDB
- The AWS SDK instance to talk to DynamoDBpublic DynamoDBTemplate(com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig dynamoDBMapperConfig, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper dynamoDBMapper)
DynamoDBTemplate
. The following combinations are
valid:amazonDynamoDB
- must not be null
dynamoDBMapperConfig
- can be null
- DynamoDBMapperConfig.DEFAULT
is used
if null
is passed indynamoDBMapper
- can be null
-
DynamoDBMapper(AmazonDynamoDB, DynamoDBMapperConfig)
is used if null
is passed inpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public <T> int count(Class<T> domainClass, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression)
count
in interface DynamoDBOperations
public <T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList<T> query(Class<T> domainClass, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression<T> queryExpression)
query
in interface DynamoDBOperations
public <T> int count(Class<T> domainClass, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression scanExpression)
count
in interface DynamoDBOperations
public <T> T load(Class<T> domainClass, Object hashKey, Object rangeKey)
load
in interface DynamoDBOperations
public <T> T load(Class<T> domainClass, Object hashKey)
load
in interface DynamoDBOperations
public <T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedScanList<T> scan(Class<T> domainClass, com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBScanExpression scanExpression)
scan
in interface DynamoDBOperations
public <T> List<T> batchLoad(Map<Class<?>,List<com.amazonaws.services.dynamodbv2.datamodeling.KeyPair>> itemsToGet)
batchLoad
in interface DynamoDBOperations
public <T> T save(T entity)
save
in interface DynamoDBOperations
public List<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch> batchSave(Iterable<?> entities)
batchSave
in interface DynamoDBOperations
public <T> T delete(T entity)
delete
in interface DynamoDBOperations
public List<com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.FailedBatch> batchDelete(Iterable<?> entities)
batchDelete
in interface DynamoDBOperations
public <T> com.amazonaws.services.dynamodbv2.datamodeling.PaginatedQueryList<T> query(Class<T> clazz, com.amazonaws.services.dynamodbv2.model.QueryRequest queryRequest)
query
in interface DynamoDBOperations
public <T> int count(Class<T> clazz, com.amazonaws.services.dynamodbv2.model.QueryRequest mutableQueryRequest)
count
in interface DynamoDBOperations
public <T> String getOverriddenTableName(Class<T> domainClass, String tableName)
getOverriddenTableName
in interface DynamoDBOperations
public <T> com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperTableModel<T> getTableModel(Class<T> domainClass)
getTableModel
in interface DynamoDBOperations
T
- The type of the domain type itselfdomainClass
- A domain typeprotected <T> void maybeEmitEvent(@Nullable T source, Function<T,DynamoDBMappingEvent<T>> factory)
Copyright © 2018. All rights reserved.