From 144cc98901577695e3a3aea3efcdb2eff8cbc95b Mon Sep 17 00:00:00 2001 From: Yeseo Date: Fri, 19 Apr 2024 12:12:11 +0900 Subject: [PATCH] refactor: Modify `CommentsRepository` (#63) --- .../qtudy/repository/comments/CommentsRepository.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/beotkkot/qtudy/repository/comments/CommentsRepository.java b/src/main/java/com/beotkkot/qtudy/repository/comments/CommentsRepository.java index c7b1c47..37e1e97 100644 --- a/src/main/java/com/beotkkot/qtudy/repository/comments/CommentsRepository.java +++ b/src/main/java/com/beotkkot/qtudy/repository/comments/CommentsRepository.java @@ -1,6 +1,7 @@ package com.beotkkot.qtudy.repository.comments; import com.beotkkot.qtudy.domain.comments.Comments; +import com.beotkkot.qtudy.domain.posts.Posts; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; @@ -9,10 +10,10 @@ public interface CommentsRepository extends JpaRepository { - Page findAllByPostId(Long postId, Pageable pageable); + Page findByPost_PostId(Long postId, Pageable pageable); - int countByPostId(Long postid); + int countByPost_PostId(Long postId); @Transactional - void deleteByPostId(Long postId); + void deleteByPost_PostId(Long postId); }