Annotation Type ObjectProjection


@Documented @Target(PARAMETER) @Retention(RUNTIME) @MethodParameterMapping(processor=@MethodParameterMappingAnnotationProcessorRef(type=org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.ObjectProjectionProcessor.class,retrieval=CONSTRUCTOR)) public @interface ObjectProjection
Maps a constructor parameter to an object projection bound to a specific object field in the indexed document.

The content of the object projection is defined in the constructor parameter type by another ProjectionConstructor.

Compared to the basic composite projection, an object projection is bound to a specific object field, and thus it yields zero, one or many values, as many as there are objects in the targeted object field. Therefore, you must take care of using a List<...> as your constructor parameter type if the object field is multi-valued.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • path

      String path
      Returns:
      The path to the object field whose object(s) 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:
      Default:
      ""