How to do it...

It is always the best practice to design the database and table schemas using an ERD model. After finalizing our schema designs, follow these steps to build our DAO layer:

  1. Let us open a MySQL workbench or a command line terminal, log in using the username root and password spring5mysql, and create the following schema definition of the hrs database:
  2. Since we will be dealing with database models, create a package, org.packt.dissect.mvc.model.data, that will contain data models representing the schema of the preceding tables. Given the two tables, create the Employee and Department data models found here:
public class Department ...

Get Spring 5.0 Cookbook 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.