728x90 반응형 query dsl2 [Spring Data JPA] jpql(@Query)이 동작하지 않을때, No property / Did you mean error Spring Data JPA에서 No property 'ids' found for type 'entity' Did you mean ''name','id''와 같이 No property, found for type, Did you mean이 발생하면서 jqpl이 작동하지 않는다. 아무리 찾고 수정해도 코드나 로직에 문제가 없었기에 개발 일정 중 하루를 낭비했다 - 결론은 import를 잘못해서 발생한 오류였음 - 해결 방법 오류발생한 import import org.springframework.data.jdbc.repository.query.Query; 아래 import로 변경 import org.springframework.data.jpa.repository.Query; 같은 스프링프레임워크의 Query.. 2023. 3. 9. [JPA] Specification 사용자 정의 함수 사용 JPA에서 Specification으로 사용자 정의 함수 where절 조건 검색하기 ### Specification public static Specification nameLike(String text) { return (root, query, cb) -> { Expression nameExpr = cb.function("fn_usrNm", String.class, root.get("name")); return cb.like(nameExpr, "%" + text + "%"); }; } 1. 사용자 정의 함수(sql function) 1개의 조건일 경우 #### Service Specification spec = Specification.where(EntitySpec.nameLike(text)); 2. .. 2023. 3. 7. 이전 1 다음 728x90 반응형