Creating a Record Model

  • You can annotate a Java class to let Dynamo work with it easily
private String id;
private String name;
private Integer age;
private Boolean isProfessor;

public UserModel(String name, Integer age, Boolean isProfessor) {
    this.name = name;
    this.age = age;
    this.isProfessor = isProfessor;
}

@DynamoDbPartitionKey
public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

15 / 22