O'Reilly logo

Spring Boot Cookbook by Alex Antonov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automatically configuring the database schema and populating it with data

Earlier in the book, in Chapter 2, Configuring Web Applications, we manually added a few entries to the database in the StartupRunner's run(…) method. While doing so programmatically can be a quick and easy way to get something going very quickly, in the long run, it is not really a good idea to do so—especially when you are dealing with a large amount of data. It is also a good practice to separate the database preparations, changes, and other configurations from the rest of the running application code, even if it is setting up the test cases. Thankfully, Spring has provided you with the support to make this task fairly easy and straightforward to solve.

We will continue ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required