我正在尝试使用com.amazonaws.services.dynamodb.datamodeling.DynamoDBMapper.save()
编写地图并收到此错误:
Exception in thread "main"
com.amazonaws.services.dynamodb.datamodeling.DynamoDBMappingException:
Unsupported type: interface java.util.Map for public java.util.Map Config.getAttributes()
DynamoDBMapper
不支持地图吗?
答案 0 :(得分:0)
创建HashMapMarshaller
public class HashMapMarshaller extends JsonMarshaller<HashMap<String, String>>
{
@Override
public String marshall(HashMap<String, String> obj) {
return super.marshall(obj);
}
@Override
public HashMap<String, String> unmarshall(Class<HashMap<String, String>> clazz, String json) {
return super.unmarshall(clazz, json);
}
}
然后将其分配给您的财产
@DynamoDBMarshalling(marshallerClass=HashMapMarshaller.class)