spring-boot - MyBatis / Srping-Boot Mapper 方法试图从具有原始返回类型 (int) 的方法返回 null
问题描述
我正在使用MyBatis / Spring-Boot
我正在学习它:)
我收到此错误消息:
Mapper 方法尝试从具有原始返回类型 (int) 的方法返回 null
在论坛中不同建议的帮助下,我尝试了不同的方式来编写它。没有工作
有代码:
@Select("INSERT INTO TB_Users(userId, firstName, lastName) VALUES( #{userId}, #{firstName}, #{lastName})")
@SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = Integer.class)
public int save(UserEntity userEntity);
谢谢你的帮助
解决方案
推荐阅读
- sql - 在查询中,如果一行缺少数据,我想从上一行中选择数据
- jenkins - Jenkins 中的 Kubernetes 插件:无法通过代理进行身份验证
- python - 如何使用wsl编写python crontab
- asp.net-core - 2 人 2 因素身份验证?
- perl - PERL5.26.1 eval tr 带有插值的运算符(骆驼书第 76 页上的示例)不起作用
- r - R中只有“1”的底部三角形和只有“0”的顶部三角形的矩阵
- c# - FirstOrDefaultAsync 在 Azure 上使用 .NET 导致 NgsqlConnection 中出现 NullReferenceException
- macos - MacOS Catalina 10.15.4 版中的“Spotlight 意外退出”,安装 Xcode 12 后发生此崩溃
- c++ - 这种奇怪的 C++ 语法有什么作用?
- c# - EditorForModel 在 EditorTemplate 中不起作用?