Beans and services

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 ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.