Annotation Interface Discriminator


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Discriminator
If you want to choose your discriminator manually you can annotate your pojo classes with this annotation. Within the value array, provide ALL discriminators that identify your pojo (if you have used different ones within mongo and do not want to change existing ones) The first entry in this list will be used for current encodings to the database.

If no discriminator annotation is present at your pojo class, the Class.getSimpleName() will be used in case a polymorphic data structure is found.

Please be aware that using the same discriminator could potentially lead to ambiguities, IF such classes are assignable to each other.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • aliases

      String[] aliases
      Default:
      {}