[Spring/JUnit] DataJpaTest์—์„œ JPAQueryFactory Bean ๋“ฑ๋ก ์—๋Ÿฌ : No qualifying bean of type 'com.querydsl.jpa.impl.JPAQueryFactory' available
ยท
Backend/Spring Boot
Spring์—์„œ JPA์™€ QueryDSL์„ ์‚ฌ์šฉํ•˜์—ฌ DB์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๊ณ  ์žˆ์—ˆ๋‹ค.๊ทธ๋ฆฌ๊ณ  Repository ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค.     ๐Ÿ’ป ๊ฐœ๋ฐœ ํ™˜๊ฒฝFramework : Spring Boot `3.2.3`DB : MySQL, H2Library : JPA, QueryDSL `5.0.0`Test : JUnit     โ—๏ธ์—๋Ÿฌ ๋ฉ”์‹œ์ง€Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'XXXCustomRepositoryImpl' defined in file [.../repository/XXXCustomRepositoryImpl.class]: Unsati..
[Spring] Spring Boot์— QueryDSL ๋„์ž…๊ธฐ
ยท
Backend/Spring Boot
์ผ๋ฐ˜์ ์œผ๋กœ Spring Boot ํ™˜๊ฒฝ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๋ฐ, Spring Data JPA๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ CRUD  ๋ฉ”์†Œ๋“œ์™€ Named Query ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์•ˆ๋˜๋Š” ๊ฒฝ์šฐ๋Š” JPQL์ด๋‚˜ Native Query๋กœ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ๋‹ค. ํ•˜์ง€๋งŒ ๋ณต์žกํ•œ ์ฟผ๋ฆฌ ๋กœ์ง์„ ๊ฐ€์ง„ ๊ฒฝ์šฐ์—๋Š” ๋ฉ”์†Œ๋“œ๋‚˜ ์ฟผ๋ฆฌ๋ฌธ์ด ๊ธธ์–ด์ ธ์„œ ๊ฐ€๋…์„ฑ์ด ๋–จ์–ด์ง€๊ฒŒ ๋œ๋‹ค. ํŠนํžˆ Paging์ด๋‚˜ Sorting์„ ๊ตฌํ˜„ํ•˜๊ฒŒ ๋  ๊ฒฝ์šฐ, ๊ตฌํ˜„์ด ๋ณต์žกํ•ด์ง€๊ฒŒ ๋œ๋‹ค.     ๐Ÿšจ ๋ฌธ์ œ ์ƒํ™ฉ ๋‚˜์˜ ๊ฒฝ์šฐ์—๋„ ์ด์ „ ํ”„๋กœ์ ํŠธ๊นŒ์ง€ Spring Data JPA๊ฐ€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” CRUD ๋ฉ”์†Œ๋“œ์™€ Named Query๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๋กœ์ง์„ ๊ตฌํ˜„ํ–ˆ์—ˆ๊ณ , ์กฐ๊ธˆ ๋” ๋ณต์žกํ•œ ์ฟผ๋ฆฌ์˜ ๊ฒฝ์šฐ์—๋Š” ๊ฐ€๋…์„ฑ์€ ์กฐ๊ธˆ์€ ๋–จ์–ด์ง€์ง€๋งŒ Native Query๋กœ ๋ณ„ ๋ฌธ์ œ์—†์ด ๊ตฌํ˜„์„..
giraffe_
'querydsl' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก