diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index dd381eeee..e75e49318 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -200,10 +200,7 @@ public void deleteApplicationByIds(List applicationIds) { @Override public List queryApplicationsByIds(List applicationIds) { - return queryFactory - .selectFrom(applicationEntity) - .where(applicationEntity.id.in(applicationIds)) - .fetch().stream() + return applicationJpaRepository.findByIdIn(applicationIds).stream() .map(applicationMapper::toDomain) .toList(); } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/ApplicationJpaRepository.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/ApplicationJpaRepository.java index 39e500b23..b9a22e8eb 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/ApplicationJpaRepository.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/repository/ApplicationJpaRepository.java @@ -9,8 +9,7 @@ public interface ApplicationJpaRepository extends JpaRepository { - @Query("select a from ApplicationEntity a join fetch a.attachments where a.id in(?1)") - List findAllByIdIn(List applicationIds); + List findByIdIn(List applicationIds); void deleteByIdIn(List applicationIds); diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java index 7c250fcd4..5cdb27498 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/recruitment/persistence/RecruitmentPersistenceAdapter.java @@ -138,6 +138,7 @@ public Long getRecruitmentCountByFilter(RecruitmentFilter filter) { .select(recruitmentEntity.count()) .from(recruitmentEntity) .join(recruitmentEntity.company, companyEntity) + .join(recruitmentEntity.recruitAreas, recruitAreaEntity) .where( eqYear(filter.getYear()), betweenRecruitDate(filter.getStartDate(), filter.getEndDate()),