Annotation Interface Field


Annotation to define custom metadata for document fields.
Author:
Oliver Gierke, Christoph Strobl, Divya Srivastava
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumeration of write strategies to define when a property is included for write conversion.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The key to be used to store the field inside the document.
    int
    The order in which various fields shall be stored.
    The actual desired target type the field should be stored as.
    The key to be used to store the field inside the document.
    Write rules when to include a property value upon conversion.
  • Element Details

    • value

      @AliasFor("name") String value
      The key to be used to store the field inside the document. Alias for name().
      Returns:
      an empty String by default.
      Default:
      ""
    • name

      @AliasFor("value") String name
      The key to be used to store the field inside the document. Alias for value().
      Returns:
      an empty String by default.
      Since:
      2.2
      Default:
      ""
    • order

      int order
      The order in which various fields shall be stored. Has to be a positive integer.
      Returns:
      the order the field shall have in the document or -1 if undefined.
      Default:
      2147483647
    • targetType

      FieldType targetType
      The actual desired target type the field should be stored as.
      Returns:
      FieldType.IMPLICIT by default.
      Since:
      2.2
      Default:
      IMPLICIT
    • write

      Write rules when to include a property value upon conversion. If set to Field.Write.NON_NULL (default) null values are not written to the target Document. Setting the value to Field.Write.ALWAYS explicitly adds an entry for the given field holding null as a value 'fieldName' : null .
      NOTESetting the value to Field.Write.ALWAYS may lead to increased document size.
      Returns:
      Field.Write.NON_NULL by default.
      Since:
      3.3
      Default:
      NON_NULL