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 example data

Define example data

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

Start my 1-month free trial

Define example data

- [Instructor] Now that we have our initial model, and it is connected to our server, or our database, I'd like to pre-load it with some initial data so when we start it we can test that it works. So again, in the same folder here, Model, let's create a new file. And this file, we're going to call it Demoloader.java. And then, let's make sure we connect it to the same package again. And then let's do some imports. So we'll do importorg.springframework.beans. factory.annotation.autowired. And I have some spelling mistake here. So we're good. All right, so let's copy this line and paste it again. And in this one, let's change from this section here, so instead of beans, it's going to be boot.commandlinerunner. And then let's copy and paste again. And from same area, we're going to call sterotype.component. And then make sure we decorate our class with component. And then let's go and define our class. Public class…

Contents