Dynamo table item
id : number
Name : string
age : number
Address : sting
Java pojo is
id : int
Name : String
age : int
Address : String
My DynamoMapperConfig is
dynamoDBMapperConfig = new DynamoDBMapperConfig.Builder()
.withTableNameOverride(DynamoDBMapperConfig.TableNameOverride.withTableNameReplacement(tableName))
.withSaveBehavior(DynamoDBMapperConfig.SaveBehavior.UPDATE_SKIP_NULL_ATTRIBUTES)
.build();
Json to be inserted is
{"id" : 1,"name":"xyz"}
Now while using DynamoMapper.save(item, dynamoDBMapperConfig) to update the record it is updating "age" attribute to 0 while address attribute is unchanged(which is required too).
This case is with all the java primitives number types like int,float etc and it is fine with wrapper classes like Integer,Float. I dont know, why primitives types are getting overridden to default values. Any suggestion?