tudobala
06/18/2016, 10:11 PM@Bean
open fun init(repository: MachineRepository) = CommandLineRunner {
repository.save(Machine("first machine"))
repository.save(Machine("2nd machine"))
}
CommandLineRunner is an Interface from Spring Boot: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-command-line-runner
and it only contains a method with this signature:
java
public void run(String... args) {
// Do something...
}
I am not sure how the first block of the code runs with success, specifically the part of CommandLineRunner { // does some stuff here...}