当前位置: 代码迷 >> 综合 >> Could not set parameters for mapping
  详细解决方案

Could not set parameters for mapping

热度:59   发布时间:2023-09-18 19:31:46.0

记一个粗心:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='pageSize', 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 #3 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 #3 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

 

导致该错误的原因  

                错误版:username like concat("%","#{username}","%")

                正确版:username like concat("%",#{username},"%")
 

  相关解决方案