紅塵羁绊 2020-08-17 13:41 采纳率: 0%
浏览 209

在做insert的时候报这种错误,哪位大牛能帮忙解答一下 java

在做insert的时候报这种错误

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='demolition', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #8 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 (8 > number of parameters, which is 7).

dao层代码

LandRecommend addLandRecommend(LandRecommend landRecommend);

mapper.xml

    <sql id="allFields">
        id,province,city,district,address,area_covered,volume,
        attachment,demolition,price,remarks,cooperation_mode,file_address,
        user_name,user_phone,create_time
    </sql>
    <insert id="addLandRecommend" parameterType="landRecommend">
        insert into land_recommend
        (<include refid="allFields"/>)
        values(#(id),#{province},#{city},#{district},#{address},#{areaCovered},
        #{volume},#{attachment},
        #{demolition},#{price},#{remarks},#{cooperationMode},
        #{fileAddress},#{userName},#{userPhone},now())
    </insert>

数据现在能正常插入到表里面,但是报出来这种错

org.apache.ibatis.binding.BindingException: Mapper method 'com.xx.xxx.xxx.LandRecommendDao.addLandRecommend' has an unsupported return type: class com.xxx.xxx.xxx.LandRecommend
  • 写回答

6条回答 默认 最新

  • i_clark 2020-08-17 14:10
    关注

    好像是 demolition 这个参数的数据类型有问题. 设置个int或者bigint?

    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料