-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#42): QueryDsl 빈 생성 Configuration 추가
queryFactory를 한번만 생성시켜놓고 가져다 쓰기 위해서
- Loading branch information
1 parent
709f384
commit 7b1eb75
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/com/proceed/swhackathon/config/jpa/QueryDslConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.proceed.swhackathon.config.jpa; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
|
||
@Configuration | ||
public class QueryDslConfig { | ||
@PersistenceContext | ||
private EntityManager em; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(em); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/proceed/swhackathon/repository/ReviewRepositoryCustom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.proceed.swhackathon.repository; | ||
|
||
import com.proceed.swhackathon.dto.review.ReviewResponseDTO; | ||
import com.proceed.swhackathon.model.Review; | ||
import org.springframework.data.domain.PageRequest; | ||
|
||
import java.util.List; | ||
|
||
public interface ReviewRepositoryCustom { | ||
public List<Review> findReviewAll(); | ||
public List<Double> reviewAvg(); | ||
public List<ReviewResponseDTO> findByStoreId(Long storeId, PageRequest pageRequest); | ||
} |