- Mybatis通用Mapper updateByPrimarykey()和insert()方法報(bào)錯(cuò)饭尝,提示jdbctype錯(cuò)誤。
Exception in thread “main” org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #6 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 無(wú)效的列類型: 1111
- springboot 項(xiàng)目mybatis plus 設(shè)置 jdbcTypeForNull (oracle數(shù)據(jù)庫(kù)需配置JdbcType.NULL, 默認(rèn)是Other)
@Bean
public ConfigurationCustomizer configurationCustomizer(){
return new MybatisPlusCustomizers();
}
class MybatisPlusCustomizers implements ConfigurationCustomizer {
@Override
public void customize(org.apache.ibatis.session.Configuration configuration) {
configuration.setJdbcTypeForNull(JdbcType.NULL);
}
}