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语句的原因
mybatis在.xml中写sql语句是的注意事项
最新推荐文章于 2024-06-30 13:14:04 发布