how to disambiguate using @DocumentField in spring data mongoDB -



how to disambiguate using @DocumentField in spring data mongoDB -

while trying save object mongo db using spring-data mongodb, getting exception.

ambiguous field mapping detected! both <child class field> , <parent class field> map same field name <field name>! disambiguate using @documentfield annotation!

i hiding field in kid class , causing issue. essential me hide field declared in super class. cannot find @documentfield annotation anywhere. how can proceed here? there other solution?

i believe error in exception. need utilize @field instead , specify different name parameter so:

public class parent { private string myfield; } @document(collection = "children") public class kid extends parent { @field("childfield") private string myfield; }

spring-data spring-data-mongodb

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -