public class DynamoDBMapperConfig
extends java.lang.Object
DynamoDBMapper
at construction; if
not provided explicitly, DEFAULT
is used. New
instances can be given to the mapper object on individual save, load, and
delete operations to override the defaults. For example:
DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBClient); // Force this read to be consistent DomainClass obj = mapper.load(DomainClass.class, key, new DynamoDBMapperConfig( ConsistentReads.CONSISTENT)); // Force this save operation to use putItem rather than updateItem mapper.save(obj, new DynamoDBMapperConfig(SaveBehavior.CLOBBER)); // Save the object into a different table mapper.save(obj, new DynamoDBMapperConfig(new TableNameOverride("AnotherTable"))); // Delete the object even if the version field is out of date mapper.delete(obj, new DynamoDBMapperConfig(SaveBehavior.CLOBBER));
Modifier and Type | Class and Description |
---|---|
static class |
DynamoDBMapperConfig.Builder
A fluent builder for DynamoDBMapperConfig objects.
|
static class |
DynamoDBMapperConfig.ConsistentReads
Enumeration of consistent read behavior.
|
static class |
DynamoDBMapperConfig.DefaultTableNameResolver
Default implementation of
DynamoDBMapperConfig.TableNameResolver that mimics the
behavior of DynamoDBMapper before the addition of
DynamoDBMapperConfig.TableNameResolver . |
static interface |
DynamoDBMapperConfig.ObjectTableNameResolver
Interface for a strategy used to determine the table name of an object
based on it's class.
|
static class |
DynamoDBMapperConfig.PaginationLoadingStrategy
Enumeration of pagination loading strategy.
|
static class |
DynamoDBMapperConfig.SaveBehavior
Enumeration of behaviors for the save operation.
|
static class |
DynamoDBMapperConfig.TableNameOverride
Allows overriding the table name declared on a domain class by the
DynamoDBTable annotation. |
static interface |
DynamoDBMapperConfig.TableNameResolver
Interface for a strategy used to determine the table name of an object
based on it's class.
|
Modifier and Type | Field and Description |
---|---|
static DynamoDBMapperConfig |
DEFAULT
Default configuration uses UPDATE behavior for saves and EVENTUALly
consistent reads, with no table name override and lazy-loading strategy.
|
Constructor and Description |
---|
DynamoDBMapperConfig(ConversionSchema conversionSchema)
Constructs a new configuration object with the conversion schema given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.ConsistentReads consistentReads)
Constructs a new configuration object with the consistent read behavior
given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.ObjectTableNameResolver objectTableNameResolver)
Constructs a new configuration object with the object table name resolver
strategy given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
Constructs a new configuration object with the pagination loading
strategy given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior)
Constructs a new configuration object with the save behavior given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior,
DynamoDBMapperConfig.ConsistentReads consistentReads,
DynamoDBMapperConfig.TableNameOverride tableNameOverride)
Deprecated.
in favor of the fluent
DynamoDBMapperConfig.Builder |
DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior,
DynamoDBMapperConfig.ConsistentReads consistentReads,
DynamoDBMapperConfig.TableNameOverride tableNameOverride,
DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
Deprecated.
in favor of the fluent
Builder |
DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior,
DynamoDBMapperConfig.ConsistentReads consistentReads,
DynamoDBMapperConfig.TableNameOverride tableNameOverride,
DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy,
com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
Deprecated.
in favor of the fluent
Builder |
DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameOverride tableNameOverride)
Constructs a new configuration object with the table name override given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameResolver tableNameResolver)
Constructs a new configuration object with the table name resolver
strategy given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameResolver tableNameResolver,
DynamoDBMapperConfig.ObjectTableNameResolver objectTableNameResolver)
Constructs a new configuration object with the table name resolver
strategies given.
|
DynamoDBMapperConfig(DynamoDBMapperConfig defaults,
DynamoDBMapperConfig overrides)
Constructs a new configuration object from two others: a set of defaults
and a set of overrides.
|
Modifier and Type | Method and Description |
---|---|
DynamoDBMapperConfig.ConsistentReads |
getConsistentReads()
Returns the consistent read behavior for this configuration.
|
ConversionSchema |
getConversionSchema() |
DynamoDBMapperConfig.ObjectTableNameResolver |
getObjectTableNameResolver()
Returns the object table name resolver for this configuration.
|
DynamoDBMapperConfig.PaginationLoadingStrategy |
getPaginationLoadingStrategy()
Returns the pagination loading strategy for this configuration.
|
com.amazonaws.metrics.RequestMetricCollector |
getRequestMetricCollector()
Returns the request metric collector or null if not specified.
|
DynamoDBMapperConfig.SaveBehavior |
getSaveBehavior()
Returns the save behavior for this configuration.
|
DynamoDBMapperConfig.TableNameOverride |
getTableNameOverride()
Returns the table name override for this configuration.
|
DynamoDBMapperConfig.TableNameResolver |
getTableNameResolver()
Returns the table name resolver for this configuration.
|
public static final DynamoDBMapperConfig DEFAULT
@Deprecated public DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior, DynamoDBMapperConfig.ConsistentReads consistentReads, DynamoDBMapperConfig.TableNameOverride tableNameOverride)
DynamoDBMapperConfig.Builder
@Deprecated public DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior, DynamoDBMapperConfig.ConsistentReads consistentReads, DynamoDBMapperConfig.TableNameOverride tableNameOverride, DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
Builder
saveBehavior
- The DynamoDBMapperConfig.SaveBehavior
to use, or null for default.consistentReads
- The DynamoDBMapperConfig.ConsistentReads
to use, or null for
default.tableNameOverride
- An override for the table name, or null for no
override.paginationLoadingStrategy
- The pagination loading strategy, or null
for default.@Deprecated public DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior, DynamoDBMapperConfig.ConsistentReads consistentReads, DynamoDBMapperConfig.TableNameOverride tableNameOverride, DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy, com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
Builder
saveBehavior
- The DynamoDBMapperConfig.SaveBehavior
to use, or null for default.consistentReads
- The DynamoDBMapperConfig.ConsistentReads
to use, or null for
default.tableNameOverride
- An override for the table name, or null for no
override.paginationLoadingStrategy
- The pagination loading strategy, or null
for default.requestMetricCollector
- optional request metric collectorpublic DynamoDBMapperConfig(DynamoDBMapperConfig.SaveBehavior saveBehavior)
saveBehavior
- the DynamoDBMapperConfig.SaveBehavior
public DynamoDBMapperConfig(DynamoDBMapperConfig.ConsistentReads consistentReads)
consistentReads
- constructs with DynamoDBMapperConfig.ConsistentReads
public DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameOverride tableNameOverride)
tableNameOverride
- constructs with DynamoDBMapperConfig.TableNameOverride
public DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameResolver tableNameResolver)
tableNameResolver
- the table name resolver.public DynamoDBMapperConfig(DynamoDBMapperConfig.ObjectTableNameResolver objectTableNameResolver)
objectTableNameResolver
- the object table name resolver.public DynamoDBMapperConfig(DynamoDBMapperConfig.TableNameResolver tableNameResolver, DynamoDBMapperConfig.ObjectTableNameResolver objectTableNameResolver)
tableNameResolver
- the table name resolverobjectTableNameResolver
- the object table name resolver.public DynamoDBMapperConfig(DynamoDBMapperConfig.PaginationLoadingStrategy paginationLoadingStrategy)
paginationLoadingStrategy
- the DynamoDBMapperConfig.PaginationLoadingStrategy
public DynamoDBMapperConfig(ConversionSchema conversionSchema)
conversionSchema
- the dynamodb ConversionSchema
public DynamoDBMapperConfig(DynamoDBMapperConfig defaults, DynamoDBMapperConfig overrides)
Used internally to merge the DynamoDBMapperConfig
provided at
construction with an overriding object for a particular operation.
defaults
- The default mapper configuration values.overrides
- The overridden mapper configuration values. Any non-null
config settings will be applied to the returned object.public DynamoDBMapperConfig.SaveBehavior getSaveBehavior()
DynamoDBMapperConfig.SaveBehavior
public DynamoDBMapperConfig.ConsistentReads getConsistentReads()
DynamoDBMapperConfig.ConsistentReads
public DynamoDBMapperConfig.TableNameOverride getTableNameOverride()
DynamoDBTable
annotation,
either by replacing the table name entirely or else by pre-pending a
string to each table name. This is useful for partitioning data in
multiple tables at runtime.public DynamoDBMapperConfig.TableNameResolver getTableNameResolver()
DynamoDBMapperConfig.TableNameOverride
.public DynamoDBMapperConfig.ObjectTableNameResolver getObjectTableNameResolver()
DynamoDBMapperConfig.TableNameOverride
.public DynamoDBMapperConfig.PaginationLoadingStrategy getPaginationLoadingStrategy()
DynamoDBMapperConfig.PaginationLoadingStrategy
public com.amazonaws.metrics.RequestMetricCollector getRequestMetricCollector()
RequestMetricCollector
public ConversionSchema getConversionSchema()
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.