DynamoDB Pojo属性值

时间:2017-06-26 22:07:35

标签: java amazon-web-services amazon-dynamodb

我为这样的dynamodb表定义了POJO:



public class DynamoDBTablePojo {

    @NonNull
    private String requestId;

    @NonNull
    private String responseId;

    private String responseBlob;

    @DynamoDBHashKey(attributeName = "RequestId")
    public String getRequestId(){return this.requestId;};

    @DynamoDBAttribute(attributeName = "ResponseId")
    public String getResponseId(){return this.responseId;};

    @DynamoDBAttribute(attributeName = "ResponseBlob")
    public String getResponseBlob() {return responseBlob;}
}




我想在java中编写一个函数,它将获取属性名称和DynamoDBTablePojo对象并返回该属性的值。如,



String func(String attributeName, DynamoDBTablePojo dynamoDBTablePojoObj){
 // returns value associated with this attribute.
}




0 个答案:

没有答案