Using Spring Data JPA for persistence
This section will introduce JPA and how to use Spring Data JPA repositories to provide Create, Retrieve, Update, and Delete (CRUD) operations in JPA easily.
Class diagram for the domain model
Since the domain model is the most important component of an application, in this section, we will design it first. The following is the simple class diagram for this web service:

There are three main domain models shown in the preceding diagram. Those are as follows:
- Tweet: This is the main domain model, which will store the actual tweet content, posted time, and posted user
- User: This is the domain model that will store the username, password, role, and bio of each user on the system
- Role: This is the enumeration to describe the role of the user
Implementation of the domain model using Spring Data JPA annotations
This section will explain the details of how to configure and use Spring Data JPA and an H2 embedded database with the domain model designed in the previous...