Class ResultProcessor

java.lang.Object
org.springframework.data.repository.query.ResultProcessor

public class ResultProcessor extends Object
A ResultProcessor to expose metadata about query result element projection and eventually post processing raw query results into projections and data transfer objects.
Since:
1.12
Author:
Oliver Gierke, John Blum, Mark Paluch, Christoph Strobl
  • Method Details

    • withDynamicProjection

      public ResultProcessor withDynamicProjection(ParameterAccessor accessor)
      Returns a new ResultProcessor with a new projection type obtained from the given ParameterAccessor.
      Parameters:
      accessor - must not be null.
      Returns:
    • getReturnedType

      public ReturnedType getReturnedType()
      Returns the ReturnedType.
      Returns:
    • processResult

      @Nullable public <T> T processResult(@Nullable Object source)
      Post-processes the given query result.
      Parameters:
      source - can be null.
      Returns:
    • processResult

      @Nullable public <T> T processResult(@Nullable Object source, org.springframework.core.convert.converter.Converter<Object,Object> preparingConverter)
      Post-processes the given query result using the given preparing Converter to potentially prepare collection elements.
      Parameters:
      source - can be null.
      preparingConverter - must not be null.
      Returns: