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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -