从myesclispse 转到idea 2017 版遇到问题。发现mybatis
出现:org.apache.ibatis.binding.BindingException: Parameter 'id' not found. Available is list
发现怎么改也不行。配置文件都是对的。最终再网上发现新版idea不会编译resource下的xml文件
解决方案在mavenpom文件中
…………
src/main/java
**/*.properties
**/*.xml
true
src/main/resources
**/*.properties
**/*.xml
true
可以解决问题。
注:mybatis中如果传入的值为null 会出现 Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type
原因:mybatis不能对null类型进行转换。(只有oracle不会)
解决方案:加
,dbcType=VARCHAR
或者设置 mybatis config中对null值的转换