android - DynamoDB mapper save only one attribute in an item Java -


i getting item record dynamodb table adding attribute (userratings) , saving again this:

 songdatabasemappingadapter song = mapper.load(songdatabasemappingadapter.class, params[0]);             song.getuserratings().add(userid + "-" + params[1] + "-" + sdf.format(date));             mapper.save(song); 

the problem in songdatabasemappingadapter have getter setters being used update gui, this:

public boolean getonestarrating() {         return onestarrating;     }      public void setonestarrating(boolean onestarrating) {          this.onestarrating = onestarrating;     } 

i need them there don't want them save attributes in database when run code save item adding attributes every element in getter/setter (mapping adapter) item end attributes (columns) below (all of star ratings below have been added shouldn't there):

userratings fivestarrating fourstarrating onestarrating 

so want change code saving userratings attribute in song item not of attributes. thinking of below, not sure how (the code below doesn't work)

  songdatabasemappingadapter song = mapper.load(songdatabasemappingadapter.class, params[0]);                 song.getuserratings().add(userid + "-" + params[1] + "-" + sdf.format(date));                 mapper.save(song.setuserratings()); 

thanks help

annotate attributes @dynamodbignore. per documentation here:

dynamodbignore

indicates dynamodbmapper instance associated property should ignored. when saving data table, dynamodbmapper not save property table.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -