To be able to retrieve and store details of a todo, we need a Todo bean and a service to retrieve and store the details.
Let's create a Todo Bean:
public class Todo { private int id; private String user; private String desc; private Date targetDate; private boolean isDone; public Todo() {} public Todo(int id, String user, String desc, Date targetDate, boolean isDone) { super(); this.id = id; this.user = user; this.desc = desc; this.targetDate = targetDate; this.isDone = isDone; } //ALL Getters }
We have a created a simple Todo bean with the ID, the name of user, the description of the todo, the todo target date, and an indicator for the completion status. We added a constructor and getters for all fields.
Let's add ...