From the course: Creating Spring Boot Microservices

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

The persistence entities

The persistence entities

- [Instructor] Now that we've established the business classes for the domain model, let's see the persistence entities. We will use Jakarta Persistence Layer, formally Java Persistence API for the object to relational mapping. Now I'm on branch 303_02, and I've created this folder called model. And then within that folder are by entity classes. So let's look at Tour and give more view here so you can see more code. So this is a class called Tour. If the Jakarta Persistence API is new to you, or you do not recognize the @Entity or @ID annotations, I suggest you hop over to the Java Persistence with JPA course in the LinkedIn Learning Library. It's pretty good. All the attributes in the class are presented here, plus the generated id, all these attributes and the generate id, and then a constructor on one line, and it takes all the fields and initializes the attributes of those fields. And then we have the many to one relationship to a tour package. Now let's look at region. Region is…

Contents