Skip to content

Commit e8d5e4c

Browse files
authored
Merge pull request #489 from TaskFlow-CLAP/CLAP-381
CLAP-381 soft delete 된 작업에 대한 알림 오류
2 parents a2b2daa + 7eca472 commit e8d5e4c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import org.springframework.data.domain.Pageable;
66
import org.springframework.data.domain.Slice;
77
import org.springframework.data.jpa.repository.JpaRepository;
8+
import org.springframework.data.jpa.repository.Query;
9+
import org.springframework.data.repository.query.Param;
810
import org.springframework.stereotype.Repository;
911

1012
import java.util.List;
@@ -13,7 +15,14 @@
1315
@Repository
1416
public interface NotificationRepository extends JpaRepository<NotificationEntity, Long> {
1517

16-
Slice<NotificationEntity> findAllByReceiver_MemberIdOrderByCreatedAtDesc(Long receiverId, Pageable pageable);
18+
@Query("SELECT n FROM NotificationEntity n " +
19+
"JOIN FETCH n.task t " +
20+
"JOIN FETCH n.receiver r " +
21+
"WHERE n.receiver.memberId = :receiverId " +
22+
"AND t.isDeleted = false " +
23+
"ORDER BY n.createdAt DESC")
24+
Slice<NotificationEntity> findAllByReceiver_MemberIdOrderByCreatedAtDesc(
25+
@Param("receiverId") Long receiverId, Pageable pageable);
1726

1827
List<NotificationEntity> findAllByReceiver_MemberId(Long memberId);
1928

0 commit comments

Comments
 (0)