Skip to content

Commit

Permalink
refactor: Modify CommentsRepository (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahyun0326 committed Apr 19, 2024
1 parent feb1617 commit 144cc98
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,10 +10,10 @@
public interface CommentsRepository extends JpaRepository<Comments, Long> {


Page<Comments> findAllByPostId(Long postId, Pageable pageable);
Page<Comments> 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);
}

0 comments on commit 144cc98

Please sign in to comment.