Annotation Type DynamoDbFlatten


  • @Target(METHOD)
    @Retention(RUNTIME)
    @SdkPublicApi
    public @interface DynamoDbFlatten
    This annotation is used to flatten attributes into top-level attributes of the record that is read and written to the database.

    This annotation supports two types of flattening:

    • Object flattening: Flattens all attributes of a separate DynamoDb bean object
    • Map flattening: Flattens all key-value pairs of a Map<String, String> as individual attributes

    The type of flattening is automatically determined based on the annotated property's type:

    • If the property is a Map<String, String>, map flattening is used
    • If the property is a DynamoDb bean class, object flattening is used

    Constraints:

    • Flattened attribute names cannot conflict with existing class attributes (validated at schema creation for objects, validated at runtime for maps)
    • Only one @DynamoDbFlatten Map<String, String> property per class (validated at schema creation)
    • Map flattening requires exactly Map<String, String> type (validated at schema creation)
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      Class<?> dynamoDbBeanClass
      Deprecated.
      This is no longer used, the class type of the attribute will be used instead.
    • Element Detail

      • dynamoDbBeanClass

        @Deprecated
        Class<?> dynamoDbBeanClass
        Deprecated.
        This is no longer used, the class type of the attribute will be used instead.
        Default:
        java.lang.Object.class