How to push `Map` type attribute to dynamodb table with map schema?
This might be related to #331, but I can't find way for my own case.
Suppose I have this POJO class:
@DynamoDBTable
class Item {
@DynamoDBHashKey
private String id;
@DynamoDBAttribute(attributeName="attr")
private Map<String, String> attributes;
}
How to save it correctly using DynamoDBMapper?
I've tried to explicitly config dynamo db using ConversionSchemas.V2 to no avail.
DynamoDBMapper mapper = new DynamoDBMapper(dynamodb, new DynamoDBMapperConfig(ConversionSchemas.V2));
I'm using aws-java-sdk-dynamodb with aws-java-sdk-bom version 1.10.18.
Hm, that should work just fine with either ConversionSchemas.V2 or the default ConversionSchemas.V2_COMPATIBLE. What problem are you seeing?
When I did mapper.save(model), I expect in dynamodb have attr column. But I'm not seeing it. Ah, is it possible because of I am using dynamodb local? Let me test it in aws dynamodb first.
Any updates on this ?
Yes, there is no problem, it's my side error where I set up the test wrongly. You can close this issue. Thanks.
Adinata
Typed in mobile, expect typi and auto corrected error. On Nov 28, 2015 4:04 AM, "Manikandan Subramanian" [email protected] wrote:
Any updates on this ?
— Reply to this email directly or view it on GitHub https://github.com/aws/aws-sdk-java/issues/520#issuecomment-160203358.
Thanks for the update.
I got the same problem and was stuck for hours - the mistake I had made was ... one of the test code was putting a blank string in the map - due to which it was breaking while reading the same map variable.