Polish samples
This commit is contained in:
@@ -16,24 +16,26 @@
|
||||
|
||||
package sample.flyway;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SampleFlywayApplication implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private PersonRepository repository;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
System.err.println(this.repository.findAll());
|
||||
}
|
||||
public class SampleFlywayApplication {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleFlywayApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner runner(final PersonRepository repository) {
|
||||
return new CommandLineRunner() {
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
System.err.println(repository.findAll());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user