[ToDo] 20231207 정리

김준영·2023년 12월 7일

하루정리

목록 보기
6/7
post-thumbnail

오늘 해결해야 할 일

1. [PerfumePedia] Contoller Service 테스팅(진행중)
2. [SSAFY] PT면접 주제(OTT) 내용 추가

해결한 일

1. Controller Service 테스팅

  • WordRepository JPQL 쿼리 수정

    • Join 사용 대신, Enum의 값 자체를 사용하도록 수정했다.

      public List<Word> findByTypeAndTypeId(Long typeId, WordType wordType) {
          String jpql = "select w from Word w where " + 
                  "w." + wordType.name().toLowerCase() +
                  ".id = :id";
      
          return em.createQuery(jpql, Word.class)
                  .setParameter("id", typeId)
                  .getResultList();
      }
    • [Spring Boot] JPA - JPQL 동적쿼리에서 자세히 볼 수 있다.

    • AutoCompleteService 테스트 완료

  • 자동완성 기능에서 반환값 수정: 별칭 값에서 이름 값으로 수정

    • 자동완성 기능 → 정상
    • 가중치에 따른 정렬 → 정상

0개의 댓글