Skip to content

@DynamoDBDocument not working #2682

@ricardoseb

Description

@ricardoseb

I'm using dynamodb-enhanced with spring webflux, but in the moment to create my table using @DynamoDBDocument i get the error caused by : Converter not found for EnhancedType(java.util.Set.myClass$AttributeName)

Describe the issue

This is my entity class:

@DynamoDbBean
public class Item {
 private String id;
private Set<Tags> tags;

@DynamoDBDocument
    public static class Tags {
        private String name;
        private String value;

        @DynamoDBAttribute
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @DynamoDBAttribute
        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
@DynamoDbPartitionKey
    public String getId() {
        return id;
    }

@DynamoDBTypeConvertedJson
    public Set<Tags> getTags() {
        return tags;
    }

//setters ...
}

And i have a method creating the table:

@Bean
    public void createItemSchema() {
TableSchema<Item> ITEM_TABLE_SCHEMA = TableSchema.fromClass(Item.class);
 DynamoDbAsyncTable<Item> itemTable = dynamoDbEnhancedAsyncClient.table(
                "Item",
                ITEM_TABLE_SCHEMA
        );
        itemTable.createTable();

    }
}

also I leave the libraries that I am using (maven):

 <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-dynamodb</artifactId>
            <version>1.12.50</version>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>dynamodb-enhanced</artifactId>
            <version>2.17.22</version>
        </dependency>

Expected Behavior

Current Behavior

image

Your Environment

  • AWS Java SDK version used: 1.12.50
  • JDK version used: 11
  • Operating System and version:mac os catalina 10.15.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions