From the course: Creating Spring Boot Microservices

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Invoking the repositories

Invoking the repositories

- [Instructor] Now let's invoke the repositories by launching the application. So we are in the application main class and we need to load the database with the collection of predefined tours and tour packages. The Explore California Travel Agency provided us with a .JSON file that represents all the possible tours and it's in the main explorer of ExploreCalifornia. There it is right there. Some of the fields map directly to the fields in our tour entity like title, description, and blurb. However some fields like price, tour package, difficulty, region, those all require conversion and in ExplorecaliApplication, that's where we're going to do that. Our Explorecali web application uses an in-memory database called H2. Spring Boot connects to H2 with the default when the dependency is provided. We need to load the data each time the application starts. So now we have services to create the tours and tour packages, but how should we invoke them before accepting web requests? Remember…

Contents