11package tutorial ;
22
33import org .springframework .beans .factory .annotation .Autowired ;
4- import org .springframework .stereotype .Component ;
54import org .springframework .boot .CommandLineRunner ;
5+ import org .springframework .stereotype .Component ;
66
77@ Component
88public class DatabaseLoader implements CommandLineRunner {
99
10- private final EmployeeRepository repository ;
10+ private final EmployeeRepository repository ;
1111
12- @ Autowired
13- public DatabaseLoader (EmployeeRepository repository ) {
14- this .repository = repository ;
15- }
12+ @ Autowired
13+ public DatabaseLoader (EmployeeRepository repository ) {
14+ this .repository = repository ;
15+ }
1616
17- @ Override
18- public void run (String ... strings ) throws Exception {
19- this .repository .save (new Employee ("Joe Biden" , 45 , 5 ));
20- this .repository .save (new Employee ("President Obama" , 54 , 8 ));
21- this .repository .save (new Employee ("Crystal Mac" , 34 , 12 ));
22- this .repository .save (new Employee ("James Henry" , 33 , 2 ));
23- }
24- }
17+ @ Override
18+ public void run (String ... strings ) throws Exception {
19+ this .repository .save (new Employee ("Joe Biden" , 45 , 5 ));
20+ this .repository .save (new Employee ("President Obama" , 54 , 8 ));
21+ this .repository .save (new Employee ("Crystal Mac" , 34 , 12 ));
22+ this .repository .save (new Employee ("James Henry" , 33 , 2 ));
23+ }
24+ }
0 commit comments