
[QueryDSL] join, paging, where, dto Qclass
·
JPA
사용 이유 jpa nativeQuery로 쿼리 조회를 하다가 다중 필터를 사용하게 되면서, where절을 유동적으로 사용하기위해 사용 // 설문조사 리스트 조회 @Query(value = "SELECT sc.content, s.* " + "FROM survey s left join survey_category sc on sc.sur_cat_id = s.category_id " + "WHERE 1=1 " + "and s.status = 'I' " + "and s.is_private = 'N' " "and s.category_id = :categoryId " , nativeQuery = true) Page findByCategoryIdAndStatus(@Param("categoryId") int catego..