vendredi 26 juin 2015

Marshalling in the Pojo Mapper?

In Dynamo, is it safe/proper practice to alter the contents of the annotated set and get methods of a pojo mapper class to perform some marshaling tasks?

e.g.

@DynamoDBAttribute(attributeName = "BookInfo")
public String[] getBookInfo(){
return new String[]{this.title, this.author}
}
public void setBookInfo(String[] info){
this.title = info[0];
this.author = info[1];
}

where title and author are not attributes but fields in the class

Note: I understand the above example is a poor use of Dynamo and the title and author should be just separate fields, but it is just a quick example.




Aucun commentaire:

Enregistrer un commentaire