![]() public class Employee = GenerationType.IDENTITY) Let’s assume that we have an employee entity, which requires a schema and sample data to be initialized in the database. Initializing Spring Boot JPA Entitiesįor loading initial data with Spring Boot, we can use the Spring Boot built in support for JPA. Let’s see how to load this initial data on startup with an example below. It is a powerful feature that lets you work in different environments. We can use the data.sql and schema.sql files in spring to gain more control over database alterations. It will search for entities in our packages and create the respective tables if we do not define any custom config and use the default configuration. Spring Boot makes it really easy to manage any type of database changes. Advertisements Loading Initial Data with Spring Boot
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |