1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package sample.mybatis.thymeleaf;
17
18 import org.springframework.boot.CommandLineRunner;
19 import org.springframework.boot.SpringApplication;
20 import org.springframework.boot.autoconfigure.SpringBootApplication;
21
22 import sample.mybatis.thymeleaf.mapper.CityMapper;
23
24
25
26
27 @SpringBootApplication
28 public class SampleThymeleafApplication implements CommandLineRunner {
29
30 public static void main(String[] args) {
31 SpringApplication.run(SampleThymeleafApplication.class, args);
32 }
33
34 private final CityMapper cityMapper;
35
36 public SampleThymeleafApplication(CityMapper cityMapper) {
37 this.cityMapper = cityMapper;
38 }
39
40 @Override
41 @SuppressWarnings("squid:S106")
42 public void run(String... args) {
43 System.out.println(this.cityMapper.findByState("CA"));
44 System.out.println(this.cityMapper.findByCountry("JP"));
45 }
46
47 }