Annotation Type DynamoDbImmutable


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface DynamoDbImmutable
    Class level annotation that identifies this class as being a DynamoDb mappable entity. Any class used to initialize a ImmutableTableSchema 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 DynamoDbImmutable:

     {@code
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<?> builder
      The builder class that can be used to construct instances of the annotated immutable class
    • Element Detail

      • builder

        Class<?> builder
        The builder class that can be used to construct instances of the annotated immutable class
      • converterProviders

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