🌱 spring
-
QueryDSL🌱 spring 2022. 10. 5. 18:57
❓QueryDSL 💡 QueryDSL은 정적 타입을 이용해 SQL과 같은 쿼리를 생성할 수 있도록 해주는 프레임워크 사용하는 이유? 실제로 Query를 작성하다보면 수 많은 쿼리를 수작업으로 생성해야 한다. 또한, 사람이 작성하면 Query는 컴파일 단계에서 오류가 있는지 없는지 알 수 없다. JPQL JPQL ( Java Persistence Query Language ) 는 엔티티 객체를 조회하는 객체지향 쿼리이다. 테이블이 아닌 객체를 검색하는 객체지향 쿼리 SQL을 추상화 하여 특정 데이터베이스에 의존하지 않는다. 데이터베이스의 방언이 바뀌어도 수정하지 않아도 된다. JPA는 JPQL을 분석하여 SQL을 생성한 후 DB에서 조회한다. 특징 SQL을 추상화한 JPA의 객체지향 쿼리 Table이 아닌..