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
