springboot/mybatis传实体类参数为空,通过设置jdbcType来减少mybatis代码量
最新推荐文章于 2022-04-06 15:07:45 发布
在使用SpringBoot和Mybatis进行插入操作时,遇到实体类参数为空导致的错误。错误信息指出JdbcType OTHER类型不允许传空。解决方法包括在Mybatis中使用条件判断,对可为空的参数添加if判断,并且为参数指定合适的jdbcType,避免使用默认的JdbcType OTHER,从而成功执行insert操作。
摘要由CSDN通过智能技术生成