June 2018
Intermediate to advanced
408 pages
11h 23m
English
We can also accomplish this using the ApplicationRunner interface. This interface is responsible for executing the code defined in the run method on application startup.
The following is the code for the ApplicationRunner interface's implementation:
package com.packt.springhighperformance.ch09.accountingservice;import java.util.stream.Stream;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.ApplicationArguments;import org.springframework.boot.ApplicationRunner;import org.springframework.stereotype.Component;import com.packt.springhighperformance.ch09.accountingservice.models.Account;import com.packt.springhighperformance.ch09.accountingservice.repositories.AccountsRepository; ...
Read now
Unlock full access