Skip to content

Commit

Permalink
feat(#42): QueryDsl 빈 생성 Configuration 추가
Browse files Browse the repository at this point in the history
queryFactory를 한번만 생성시켜놓고 가져다 쓰기 위해서
  • Loading branch information
ghdcksgml1 committed Jan 15, 2023
1 parent 709f384 commit 7b1eb75
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
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);
}
}
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);
}

0 comments on commit 7b1eb75

Please sign in to comment.