一、可以在SQL中指定类型:
@Insert("insert into student values(#{name,jdbcType=NULL},#{age})")
int addStudent(@Param("name")String name, @Param("age") int age);
二、可以进行全局配置(单独使用MyBatis时可如下配置)
如果不进行配置,将报错
MyBatis: 向oracle表中插入null字段的处理
阅读 33
2023-10-01
一、可以在SQL中指定类型:
@Insert("insert into student values(#{name,jdbcType=NULL},#{age})")
int addStudent(@Param("name")String name, @Param("age") int age);
二、可以进行全局配置(单独使用MyBatis时可如下配置)
如果不进行配置,将报错
相关推荐
精彩评论(0)