Skip to content

Commit

Permalink
feat: 리뷰 쿼리 성능 테스트를 위한 세팅
Browse files Browse the repository at this point in the history
* 조인을 사용하는 쿼리와 사용하지 않는 쿼리
  • Loading branch information
EunChanNam committed Dec 4, 2023
1 parent f03d439 commit 5d613a2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -23,6 +24,7 @@ public class ReviewQueryTestController {
private final ReviewQueryDslRepository reviewQueryDslRepository;

@Transactional(readOnly = true)
@GetMapping("/join")
public ResponseWrapper<ReviewResponse> withJoin() {
List<Review> reviews = reviewQueryDslRepository.joinWithLikeQuery()
.stream()
Expand All @@ -32,6 +34,7 @@ public ResponseWrapper<ReviewResponse> withJoin() {
}

@Transactional(readOnly = true)
@GetMapping("/no_join")
public ResponseWrapper<ReviewResponse> withoutJoin() {
List<Review> reviews = reviewQueryDslRepository.noJoinQuery();
return ReviewResponseAssembler.toWrappedReviewResponse(reviews);
Expand Down

0 comments on commit 5d613a2

Please sign in to comment.