【发布时间】:2014-10-17 12:15:08
【问题描述】:
在尝试使用 Spring-Data MongoDB 将 Object 保存到 mongo DB 时,我遇到了这个异常。
Ambiguous field mapping detected! Both <child class field> and <parent class field> map to the same field name <field name>! Disambiguate using @DocumentField annotation!
我在子类中隐藏了一个字段,这导致了问题。但这对我来说隐藏在超类中声明的字段是必不可少的。我在任何地方都找不到 @DocumentField 注释。我该如何继续?有没有其他解决办法?
【问题讨论】:
-
我有同样的问题,因为我想在 mongodb 和 neo4j 中存储基本类型。你解决了这个问题吗?
标签: spring-data spring-data-mongodb