日期:2014-05-16  浏览次数:20639 次

mybatis 新增修改,参数要加jdbcType

好像新的mybatis要求mapper中对于允许为空的字段,必须注明jdbcType,例如:
#{projectName,jdbcType=VARCHAR} ,
否则在增加、修改数据时会出现错误:
### Error updating database.? Cause: org.apache.ibatis.type.TypeException: Error setting null parameter.? Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: 无效的列类型: 1111
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### Cause: org.apache.ibatis.type.TypeException: Error setting null parameter.? Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: 无效的列类型: 1111