首页 > 其他分享 >@MapKey is required

@MapKey is required

时间:2023-06-15 21:33:39浏览次数:30  
标签:返回 map required resultMap resultType MapKey

@MapKey is required 

这就是mybatis的annotation的一个提醒,可以直接忽略,不影响代码编译;

为啥出现这种情况,因为我们很烂,sql中返回的对象不愿意定义一个 resultMap,select默认就是返回list,不指定resultMap或者resultType,默认就是组装为map对象返回;

注意:一定要指定 

resultType ="map"

 

 代码正常解析即可

 

标签:返回,map,required,resultMap,resultType,MapKey
From: https://www.cnblogs.com/huahua035/p/17484172.html

相关文章