Annotation Type DynamoDbBean


@Target(TYPE) @Retention(RUNTIME) public @interface DynamoDbBean
Class level annotation that identifies this class as being a DynamoDb mappable entity. Any class used to initialize a BeanTableSchema must have this annotation. If a class is used as an attribute type within another annotated DynamoDb class, either as a document or flattened with the DynamoDbFlatten annotation, it will also require this annotation to work automatically without an explicit AttributeConverter.

Attribute Converter Providers
Using AttributeConverterProviders is optional and, if used, the supplied provider supersedes the default converter provided by the table schema.

Note:

  • The converter(s) must provide AttributeConverters for all types used in the schema.
  • The table schema DefaultAttributeConverterProvider provides standard converters for most primitive and common Java types. Use custom AttributeConverterProviders when you have specific needs for type conversion that the defaults do not cover.
  • If you provide a list of attribute converter providers, you can add DefaultAttributeConverterProvider to the end of the list to fall back on the defaults.
  • Providing an empty list {} will cause no providers to get loaded.
Example using attribute converter providers with one custom provider and the default provider:
 
 (converterProviders = {CustomAttributeConverter.class, DefaultAttributeConverterProvider.class});
 
 

Example using DynamoDbBean:

 
 @DynamoDbBean
 public class Customer {
     private String id;
     private Instant createdOn;

     @DynamoDbPartitionKey
     public String getId() {
          return this.id;
     }

     public void setId(String id) {
          this.id = id;
     }

     public Instant getCreatedOn() {
          return this.createdOn;
     }
     public void setCreatedOn(Instant createdOn) {
          this.createdOn = createdOn;
      }
 }
 
 
  • Element Details

    • converterProviders

      Class<? extends AttributeConverterProvider>[] converterProviders
      Default:
      {software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.class}