오류: 부적합한 열 인덱스

hanahana·2022년 10월 30일
0
post-thumbnail

심각: 경로 []의 컨텍스트 내의 서블릿 [appServlet]을(를) 위한 Servlet.service() 호출이, 근본 원인(root cause)과 함께, 예외 [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='searchValue', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: 부적합한 열 인덱스]을(를) 발생시켰습니다. java.sql.SQLException: 부적합한 열 인덱스

구글링했을때는 null을 입력할수 있도록 하라는 말만나와서 도움이 되지 않았다, 내 경우는
where title = '%||#{value}||%'로 쓴게 원인이었다.
where title = '%'||#{value}||'%' 로 %사이에 '를 제대로 적어주니 정상적으로 값이 나왔다.

추가로 만약 내가 보낸 값이 null이라면 if문을 사용할때는 <if test="searchValue != null"> 해주면 null값을 제대로 인식한다

profile
hello world

0개의 댓글