Skip to content

Commit

Permalink
feat: Modify CommentsRepository (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahyun0326 committed Mar 19, 2024
1 parent 96b8638 commit e86886e
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package com.beotkkot.qtudy.repository.comments;

import com.beotkkot.qtudy.domain.comments.Comments;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

public interface CommentsRepository extends JpaRepository<Comments, Long> {
// int countByPostId(Long postid);

// @Transactional
// void deleteByPostId(Long postId);

Page<Comments> findAllByPostId(Long postId, Pageable pageable);

int countByPostId(Long postid);

@Transactional
void deleteByPostId(Long postId);
}

0 comments on commit e86886e

Please sign in to comment.