CROSS JOIN
-
JPA의 Cross Join 개선하기Back-end/TIL 2022. 4. 20. 09:29
📌 상황 아래 예시 코드에서 PharmacyEmployee 엔티티는 Pharamcy, PharmacyEmpUser 엔티티와 각각 N:1 관계이다. 아래와 같이 JPQL 작성시 Join을 명시하지 않았다. public interface PharmacyEmployeeRepository extends JpaRepository { @Query("select pe.id as id, " + "pe.pharmacy.pharmacyName as pharmacyName, " + "pe.pharmacyEmpUser.email as email, " + "pe.pharmacyEmpUser.name as name " + "from PharmacyEmployee pe " + "where pe.pharmacy.id = :pharm..