I am working in Android app that sync data in DynamoDB
I need to insert attribute List<Map<String, Object>>
here is my DynamoDB table structure
public class AmznDynamoDeviceDB {
private String identityID;
private String deviceName;
private List<Map<String, Object>> channels;
@DynamoDBHashKey(attributeName = "identityID")
public String getIdentityId(){
return this.identityID;
}
public void setIdentityId(String identityID){
this.identityID = identityID;
}
@DynamoDBAttribute(attributeName = "deviceName")
public String getDeviceName(){
return this.deviceName;
}
public void setDeviceName(String deviceName){
this.deviceName = deviceName;
}
@DynamoDBAttribute(attributeName = "channels")
public List<Map<String, Object>> getChannels(){
return this.channels;
}
public void setChannels(List<Map<String, Object>> channels){
this.channels = channels;
}
}
and i am getting the following error when insert in DynamoDB
W/System.err: com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMappingException: Cannot marshall type class java.lang.Object without a custom marshaler or @DynamoDBDocument annotation.
Can i insert java.lang.Object in Map element in DynamoDB.
Note : If i use @DynamoDBMarshalling the stores data as String i need to insert as List<Map<String, Object>>
Thanks in advance.