Skip to content

Commit

Permalink
⚙️ :: (#445) join
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsoftj1123 committed Nov 12, 2023
1 parent cef35c7 commit d24e2b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ public void deleteApplicationByIds(List<Long> applicationIds) {

@Override
public List<Application> queryApplicationsByIds(List<Long> applicationIds) {
return queryFactory
.selectFrom(applicationEntity)
.where(applicationEntity.id.in(applicationIds))
.fetch().stream()
return applicationJpaRepository.findByIdIn(applicationIds).stream()
.map(applicationMapper::toDomain)
.toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

public interface ApplicationJpaRepository extends JpaRepository<ApplicationEntity, Long> {

@Query("select a from ApplicationEntity a join fetch a.attachments where a.id in(?1)")
List<ApplicationEntity> findAllByIdIn(List<Long> applicationIds);
List<ApplicationEntity> findByIdIn(List<Long> applicationIds);

void deleteByIdIn(List<Long> applicationIds);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit d24e2b9

Please sign in to comment.