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.
Using Spring Data JPA for persistence
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...