Annotation Type FieldProjection


@Documented @Target(PARAMETER) @Retention(RUNTIME) @MethodParameterMapping(processor=@MethodParameterMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.FieldProjectionProcessor.class,retrieval=CONSTRUCTOR)) public @interface FieldProjection
Maps a constructor parameter to a projection to the value of a field in the indexed document.
See Also:
  • SearchProjectionFactory.field(String, Class, ValueModel)
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.hibernate.search.engine.search.common.ValueConvert
    Deprecated.
    Use valueModel() instead.
     
    org.hibernate.search.engine.search.common.ValueModel
     
  • Element Details

    • path

      String path
      Returns:
      The path to the index field whose value will be extracted. Defaults to the name of the annotated constructor parameter, if it can be retrieved (requires the class to be compiled with the -parameters flag; otherwise an empty path will lead to a failure).
      See Also:
      • SearchProjectionFactory.field(String, Class)
      Default:
      ""
    • convert

      @Deprecated org.hibernate.search.engine.search.common.ValueConvert convert
      Deprecated.
      Use valueModel() instead. Note, setting convert() to non-default ValueConvert.NO will result in an exception at runtime, use valueModel() with ValueModel.INDEX instead.

      Setting valueModel() to any non-default value will take precedence over convert() default ValueConvert.YES value.

      Returns:
      A value controlling how the data fetched from the backend should be converted.
      See Also:
      • ValueConvert
      • SearchProjectionFactory.field(String, Class, org.hibernate.search.engine.search.common.ValueConvert)
      Default:
      DEFAULT
    • valueModel

      org.hibernate.search.engine.search.common.ValueModel valueModel
      Returns:
      The model value, determines how the data fetched from the backend should be converted.
      See Also:
      • ValueModel
      • SearchProjectionFactory.field(String, Class, ValueModel)
      Default:
      DEFAULT