JPA 프로젝트에서 findByItemContaining 등 sql에서의 like 구문 실행 시
같은 method를 두 번 실행하게 되면 오류가 발생하는 상황이 있다.
https://github.com/spring-projects/spring-data-jpa/issues/2472
Issue with spring-data "startingWith" and hibernate 5.6.7: Parameter value [\] did not match expected type [java.lang.String (n/
Hello, I am trying to fetch some entity using a “find all by property starting with” query which amount to a CriteriaQuery using javax.persistence.criteria.CriteriaBuilder.like(Expression, String, ...
github.com
해당 내용을 다룬 이슈 내용을 살펴보면 hibernate에서 문제가 있는 경우로, hibernate 버전을 5.6.5.Final로 내려주면 해결된다.
스프링 부트 2.6.7로 initializer 구성 시 자동으로 문제 있는 버전을 사용하게 되는데.. ㅡㅡ
gradle 설정
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation('org.hibernate:hibernate-core:5.6.5.Final')
implementation('org.springframework.boot:spring-boot-devtools')
}
그냥 따로 implementation 설정 추가하면 자동으로 버전 교체해줍니다!
혹시나 해서 configurations에 compile.exclude group: 'org.hibernate' 도 추가해봤었는데 딱히 다른 점은 찾지 못했습니다.
'Spring > 기타' 카테고리의 다른 글
[Spring boot] swagger 기본 설정 (0) | 2022.05.29 |
---|---|
[Spring boot] mybatis 설정 sqlsession 관련 설정이 필요없는 이유 (0) | 2022.05.09 |
Error executing DDL 오류 해결방법 (0) | 2022.02.07 |
gradle 전체 테스트 수행 시 test events were not received 문구 (0) | 2022.02.06 |
IntelliJ 프로젝트 JDK 버전 변경하기 (0) | 2022.01.13 |