No converter found capable of converting from type [org.bson.types.ObjectId] to type [java.lang.Inte

编程入门 行业动态 更新时间:2024-10-22 20:27:09

No converter found capable of converting from <a href=https://www.elefans.com/category/jswz/34/1769883.html style=type [org.bson.types.ObjectId] to type [java.lang.Inte"/>

No converter found capable of converting from type [org.bson.types.ObjectId] to type [java.lang.Inte

No converter found capable of converting from type [org.bson.types.ObjectId] to type [java.lang.Integer]

在使用MongoDB进行查询时报错

报错语句为 类型不兼容,表里的字段类型与实体类字段类型不符

查看MongoDB 与实体类对比

 

 结果发现二者没有任何区别这就让人纳闷,我怀疑是以为mongoDB自带的 _id 会让JAVA 误以为是 id  ,修改字段名与实体类名;

 

 

重新启动测试一下

 

完美解决,原因:两个ID冲突了

更多推荐

No converter found capable of converting from type [org.bson.types.ObjectId] to

本文发布于:2024-03-05 05:07:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1711384.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:type   org   converting   converter   capable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!