From the course: Spring Boot 2.0 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Build a data repository

Solution: Build a data repository

From the course: Spring Boot 2.0 Essential Training

Start my 1-month free trial

Solution: Build a data repository

(upbeat music) - [Instructor] Now it's time for me to show you my solution to this repository. I made modifications to the three files. The first one is our staff member class. You'll see that I annotated this with at entity and table for the class, and then at ID and column for all of our attributes. On line 23, you'll see the enumerated annotation that I was telling you about so that it can store the enum in the database and retrieve it and cast it into an enum in the application. You'll also notice on line 27 that I went ahead and set a new staff member to have a random UUID. And this is specifically so that I have a way to set the UUID because I don't have a way of doing it in the database in the way I've got it configured. The next element that I did was I created a staff repository. And this once again is an empty file. That is an interface that extends JPA repository. It has a staff member and a string as the ID…

Contents