뭐든지시작이반이다
Dream Future
뭐든지시작이반이다
  • 분류 전체보기
    • Spring
      • 개념
      • 기타
    • Java
    • Algorithm
      • 알고리즘 정리
    • DB
      • Postgresql
    • 트러블슈팅
    • Git & Github
    • V&V
    • EFK
    • 북스터디
    • 기타

인기 글

최근 댓글

전체 방문자
오늘
어제

블로그 메뉴

  • 홈
  • 태그
  • 방명록

태그

  • multimodule
  • JPA
  • mybatis
  • gitignore
  • git
  • fluentd
  • Controller
  • springboot
  • Kibana
  • gradle
  • spring
  • Hibernate
  • github
  • 알고리즘
  • sqlSessionTemplate
  • 대규모서비스
  • efk
  • dirtyChecking
  • spring-boot
  • SelectionSort
  • Kotlin
  • lombok
  • SqlSessionFactory
  • 트러블슈팅
  • ambiguous오류
  • auditing
  • 파티셔닝
  • springbot
  • requestmapping
  • docker
hELLO · Designed By 정상우.
뭐든지시작이반이다

Dream Future

[JPA/hibernate] Parameter value [\] did not match expected type [~] 오류 해결방법
Spring/기타

[JPA/hibernate] Parameter value [\] did not match expected type [~] 오류 해결방법

2022. 5. 15. 20:30

오류 구문

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
    'Spring/기타' 카테고리의 다른 글
    • [Spring boot] swagger 기본 설정
    • [Spring boot] mybatis 설정 sqlsession 관련 설정이 필요없는 이유
    • Error executing DDL 오류 해결방법
    • gradle 전체 테스트 수행 시 test events were not received 문구
    뭐든지시작이반이다
    뭐든지시작이반이다
    기록장입니다.

    티스토리툴바