Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- window
- 추가합격
- 커밋옮기기
- SSAFY #싸피 #7기 #합격 #개발
- JsonObect
- commit
- tmehz
- 의존성주입
- 삼성 #교육 #개발자 #웹
- gitlab
- 백준
- pymysql
- 윈도우우분투
- 이중우선순위큐
- 프로시저
- SSAFY
- 프로젝트회고록
- Java
- mybatis
- IntelliJ
- UnsupportedOperationException
- 싸피
- github
- RequiredArgsConstructor
- 백엔드
- BOJ
- 면접합격
- SQL
- BFG
- treeset
Archives
- Today
- Total
목록cs (1)
데굴데굴 굴러가는 개발 블로그

스프링에서 DI(의존성 주입) 시 총 3가지 방법으로 의존성을 주입할 수 있다. Field(필드) 주입 Setter(수정자) 주입 Constructor(생성자) 주입 Field 주입 멤버 객체에 @Autowired로 의존성을 주입 @Service public class Example{ @Autowired private ExampleService exampleService; @Autowired private ExampleRepository exampleRepository; } Setter 주입 setter 함수에 @Autowired로 의존성 주입 @Service public class Example{ private ExampleService exampleService; private ExampleRepos..
개발/Spring
2022. 11. 1. 09:48