June 2018
Intermediate to advanced
408 pages
11h 23m
English
Spring Data JPA provides a way to execute database manipulation commands on the application startup. As the schema will be generated in the database from the JPA entity configuration and ddl-auto property value, we have to take care to insert the account records in the accounts table only. The following are the steps to accomplish this:
spring.datasource.initialization-mode=always
INSERT INTO accounts (ACCT_NAME) VALUES ('Savings'), ('Current'), ('Fixed Deposit'), ('Recurring Deposit'), ('Loan');
That's it! When we start the application, Spring will ...
Read now
Unlock full access