February 2019
Intermediate to advanced
442 pages
11h 46m
English
We will use Spring Data JPA to interact with the database, so first we need to write entity classes. An entity class will be mapped to a database table, and its attributes are mapped to the table columns. The JPA entity class is a user-defined POJO class, which is nothing but an ordinary Java class with certain JPA specific annotation and is capable of presenting the objects in the database.
We will create a separate entity class for each of the tables except the link table user_role, which is handled with the @ManyToMany annotation. The details are as follows.