Using StringSets Amazon DynamoDB Android

0 votes

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?

Feb 28, 2022 in Others by Edureka
• 13,690 points
355 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Others

0 votes
1 answer

No Network Security Config specified, using platform default - Android Log

 I had the same problem as which ...READ MORE

answered Feb 18, 2022 in Others by Aditya
• 7,680 points
5,348 views
0 votes
1 answer
0 votes
0 answers
0 votes
0 answers

"unable to locate adb" using Android Studio

While testing my app in a real ...READ MORE

May 1, 2022 in Others by Kichu
• 19,040 points
531 views
0 votes
1 answer

How to prepare an APK for the Amazon Android App Store

you should use zipalign during every build, ...READ MORE

answered Jun 1, 2022 in Others by nisha
• 2,210 points
594 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP