Skip to content

Commit e899d79

Browse files
committed
refactor: AI Report Fetch Join Apply #95
1 parent 032cac1 commit e899d79

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/sopt/comfit/report/domain/AIReportRepository.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Page<AIReport> findByExperienceUserIdAndKeyword(
2323
Pageable pageable
2424
);
2525

26-
Optional<AIReport> findByExperienceUserIdAndId(Long userId, Long id);
26+
@Query("SELECT a FROM AIReport a " +
27+
"JOIN FETCH a.company " +
28+
"JOIN FETCH a.experience " +
29+
"WHERE a.experience.user.id = :userId AND a.id = :id")
30+
Optional<AIReport> findByExperienceUserIdAndId(@Param("userId") Long userId, @Param("id") Long id);
31+
2732
boolean existsByCompanyIdAndExperienceUserId(Long companyId, Long userId);
2833
}

0 commit comments

Comments
 (0)