From the course: Building Full-Stack Apps with React and Spring

Unlock the full course today

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

Define first model class

Define first model class

From the course: Building Full-Stack Apps with React and Spring

Start my 1-month free trial

Define first model class

- [Instructor] Now let's go ahead and code our initial model. So if you go in the root directory of our CRM here, you have a source folder. Now click on this folder, and then go all the way down to the last file on the tree. So in this CRM folder, we're going to create a new folder, and we're going to call this one model. And inside of that model folder, we're going to create a new file, and we're going to call this one Contact.Java. And in this file, we'll define our model. So first of all, we're going to create the package, which will be com.crm.model, like so, and then what we'll do is import a few things that we'll need momentarily. So javax.persistence.Entity, and then let's make sure that we import that. And then let's copy it and paste it two more times, and what we'll do, we'll just change the last here, so this is going to be GeneratedValue, and this one is going to be Id. And let's just remove double code here. All right, and also we need to import Lombok.Data. All right, so…

Contents