Interface ResultRowMapper<RT>


public interface ResultRowMapper<RT>
A strategy that converts the raw results (Object[]) of the hibernate query to a different representation.
  • Method Details

    • paths

      default List<String> paths()
      Returns:
      paths that should be added to the query builder
    • createInstanceOfResultType

      @Nullable RT createInstanceOfResultType(CustomSelection customSelection)
      Returns an instance of the result type. This is called once per result row.
    • mapToOnePath

      RT mapToOnePath(List<Path> paths, ResultRowMapper.ValueProvider queryResultProvider, RT result, SelectionRegistry rootSelectionRegistry)
      Called for to-one paths.
      Parameters:
      paths - all the paths that should be mapped.
      queryResultProvider - provides access to the query result for the current row and a given path
      result - an instance of the result type for the current row
      rootSelectionRegistry - the root selection registry that may be used to get the desired path order (if applicable)
      Returns:
      an instance of the result type (typically the same instance that is given to this method)
    • mapToManyPath

      RT mapToManyPath(List<Path> paths, List<ResultRowMapper.ValueProvider> queryResultProviders, RT result, SelectionRegistry rootSelectionRegistry)
      Called for to-many paths.
      Parameters:
      paths - all the paths that should be mapped.
      queryResultProviders - provides access to the query results for the current row and a given path. A List as it's a to-many path
      result - an instance of the result type for the current row
      rootSelectionRegistry - the root selection registry that may be used to get the desired path order (if applicable)
      Returns:
      an instance of the result type (typically the same instance that is given to this method)