Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import com.example.seatchoice.entity.Comment;
import com.example.seatchoice.entity.Review;
import java.util.List;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CommentRepository extends JpaRepository<Comment, Long> {

// @EntityGraph(attributePaths = {"member"})
List<Comment> findAllByReview(Review review);

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public Slice<ReviewInfoResponse> searchBySlice(Long lastReviewId, Long seatId,
Pageable pageable) {
List<Review> reviews = queryFactory
.selectFrom(review)
.join(review.theaterSeat).fetchJoin()
.where(
ltReviewId(lastReviewId), // review.id < lastReviewId
review.theaterSeat.id.eq(seatId)
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ spring:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
default_batch_fetch_size: 100

# 이미지 용량
servlet:
Expand Down