Skip to content

Commit 366e4f4

Browse files
authored
Merge pull request #158 from prography/develop
fix: lazy loading error modified from fetchjoin
2 parents 8b16be1 + f16fc61 commit 366e4f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/example/cherrydan/activity/repository/ActivityAlertRepository.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ public interface ActivityAlertRepository extends JpaRepository<ActivityAlert, Lo
2222

2323

2424
/**
25-
* 당일 생성된 알림 미발송 활동 알림들 조회
25+
* 당일 생성된 알림 미발송 활동 알림들 조회 (Campaign과 User를 Fetch Join으로 함께 조회)
2626
*/
27-
@Query("SELECT aa FROM ActivityAlert aa WHERE aa.alertStage = 0 AND aa.isVisibleToUser = true AND aa.alertDate = :alertDate")
27+
@Query("SELECT aa FROM ActivityAlert aa " +
28+
"JOIN FETCH aa.campaign c " +
29+
"JOIN FETCH aa.user u " +
30+
"WHERE aa.alertStage = 0 AND aa.isVisibleToUser = true AND aa.alertDate = :alertDate")
2831
List<ActivityAlert> findTodayUnnotifiedAlerts(@Param("alertDate") LocalDate alertDate);
2932

3033
/**

0 commit comments

Comments
 (0)