Is there a way to convert a collection of enums? I've tried the following without success:
@DynamoDBTypeConvertedEnum
@DynamoDBAttribute(attributeName="myEnums")
private Collection<MyEnum> myEnums;
Is there a way to convert a collection of enums? I've tried the following without success:
@DynamoDBTypeConvertedEnum
@DynamoDBAttribute(attributeName="myEnums")
private Collection<MyEnum> myEnums;
In order to save it as collection (i.e. set of strings), please use @DynamoDBTyped
annotation with SS
attribute type.
@DynamoDBTyped(DynamoDBAttributeType.SS)
@DynamoDBAttribute(attributeName = "myEnums")
public Set<MyEnum> getMyEnums() {
return myEnums;
}
myEnums is a Set of enums, not an enum itself.
The enum type is only supported by override or custom converter
Because you have a set of enums, you will need to use a customer converter. So remove the @DynamoDBTypeConvertedEnum
annotation and use a custom converter. You can see an example I have posted before here. Its a generic Set example but it will work for your enum Set.
EDIT: i.e. use DynamoDBTypeConverted