I have an android application which uses Amazon DynamoDB. My table of users look like this:
@DynamoDBTable(tableName = Const.TEST_TABLE_NAME)
public static class User {
private int userID;
private String username;
private String password;
private String email;
@DynamoDBHashKey(attributeName = "userID")
public int getUserID() {
return userID;
}
public void setUserID(int userID) {
this.userID = userID;
}
@DynamoDBAttribute(attributeName = "username")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@DynamoDBAttribute(attributeName = "password")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@DynamoDBAttribute(attributeName = "email")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
And everything works fine. My question is, if I have a string set in my table how can I insert it to my code? Using String[] doesn't work( I've tried adding:
private String[] favourites;
@DynamoDBAttribute(attributeName = "favourites")
public String[] getFavourites() {
return favourites;
}
public void setFavourites(String[] favourites) {
this.favourites = favourites;
}
) but it keeps throwing errors. Can somebody help me?