mybatis在.xml中写sql语句是的注意事项

mybatis在.xml中写sql语句是的注意事项
用--这个注释 一条SQL语句时候这条SQL语句也会执行,到时候就会报一些莫名其妙的错误
例如
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property=‘Second_PageHelper’, mode=IN, javaType=class java.lang.Integer, jdbcType=null, numericScale=null, resultMapId=‘null’, jdbcTypeName=‘null’, expression=‘null’}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 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 (1 > number of parameters, which is 0).

这个是<sql>这个标签中写了俩sql语句的原因
————————————————
版权声明:本文为CSDN博主「fzc3088954783」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fzc3088954783/article/details/105770138

posted @ 2020-04-26 15:39  冯天羽  阅读(930)  评论(0编辑  收藏  举报