-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMainApplication.java
32 lines (26 loc) · 1013 Bytes
/
MainApplication.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package jpa.practice.relationship.onetomany2;
import jpa.practice.relationship.manytomany.service.BookstoreService;
import jpa.practice.relationship.onetomany2.service.BoardService;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class MainApplication {
private final BoardService boardService;
public MainApplication(BoardService boardService) {
this.boardService = boardService;
}
public static void main(String[] args) {
SpringApplication.run(MainApplication.class, args);
}
@Bean
public ApplicationRunner init() {
return args -> {
boardService.init();
//boardService.fetchPostWithAllThrowException();
//boardService.fetchPostWithAllSeparate();
boardService.fetchPostAllWithAll();
};
}
}