Skip to content

[fix] 토론 댓글 조회 로직 변경 #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ public interface DebateParticipationJpaRepository extends JpaRepository<DebatePa

Optional<DebateParticipation> findByDebateAndMember(Debate debate, Member member);

@Query("select dp from DebateParticipation dp join fetch dp.member where dp.debate.id = :debateId order by dp.id desc")
@Query("select dp from DebateParticipation dp join fetch dp.member where dp.debate.id = :debateId and dp.comment is not null order by dp.id desc")
List<DebateParticipation> findAllWithMemberByDebateIdOrderByIdDescJPQL(Long debateId);

@Query("select dp from DebateParticipation dp join fetch dp.member where dp.debate.id = :debateId order by dp.heartCount desc, dp.id desc")
@Query("select dp from DebateParticipation dp join fetch dp.member where dp.debate.id = :debateId and dp.comment is not null order by dp.heartCount desc, dp.id desc")
List<DebateParticipation> findAllWithMemberByDebateIdOrderByHeartCountDescJPQL(Long debateId);

@Query("select distinct dp from DebateParticipation dp left join fetch dp.debateParticipationHearts join fetch dp.member where dp.debate.id = :debateId order by dp.id desc")
@Query("select distinct dp from DebateParticipation dp left join fetch dp.debateParticipationHearts join fetch dp.member where dp.debate.id = :debateId and dp.comment is not null order by dp.id desc")
List<DebateParticipation> findAllWithMemberAndDebateParticipationHeartByDebateIdOrderByIdDescJPQL(Long debateId);

@Query("select distinct dp from DebateParticipation dp left join fetch dp.debateParticipationHearts join fetch dp.member where dp.debate.id = :debateId order by dp.heartCount desc, dp.id desc")
@Query("select distinct dp from DebateParticipation dp left join fetch dp.debateParticipationHearts join fetch dp.member where dp.debate.id = :debateId and dp.comment is not null order by dp.heartCount desc, dp.id desc")
List<DebateParticipation> findAllWithMemberAndDebateParticipationHeartByDebateIdOrderByHeartCountDescJPQL(Long debateId);

@Query("select dp from DebateParticipation dp join fetch dp.debate where dp.member.id = :memberId order by dp.id desc")
Expand Down
Loading