Could not find value method on SQL annotation. Cause: org.apache.ibatis.builder.BuilderException:

こ雲淡風輕ζ 提交于 2020-01-23 02:08:32

前言:
许久没有使用mysql,报此错,解决后记录

1.原因一:

xml中的sql语句,没有使用mybatis正确的符号;

&lt;      <     小于号    <=&lt;=的表示是一个意思
&gt;      >     大于号
&amp;     &&apos;    ’     单引号
&quot;    "     双引号

2.原因二:

对象属性名称、表中字段名称,输入错误

    @Results(
            id = "resultMap",
            value = {
                    @Result(id = true, column = "id", property = "id"),
                    @Result(column = "third_id", property = "thirdId"),
                    @Result(column = "version", property = "version"),
                    @Result(column = "form_data_id", property = "formDataId"),
                    @Result(column = "dispose_id", property = "disposeId"),
                    @Result(column = "created_time", property = "createTime"), // update_time,我在此处写错 
                    @Result(column = "updated_time", property = "updateTime")
            }
    @Select("<script>"
            + " select * from relationship where third_id in "
            + " <foreach collection= 'thirdIds' item='id' separator=',' open= '(' close= ')' > "
            + " #{id}"
            + " </foreach>"
            + "</script>")
    List<Relationship> batchFind(@Param("thirdIds") List<String> thirdIds);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!