Interface ResultRowMapper<RT>
public interface ResultRowMapper<RT>
A strategy that converts the raw results (
Object[]) of the hibernate query to a different representation.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncreateInstanceOfResultType(CustomSelection customSelection) Returns an instance of the result type.mapToManyPath(List<Path> paths, List<ResultRowMapper.ValueProvider> queryResultProviders, RT result, SelectionRegistry rootSelectionRegistry) Called for to-many paths.mapToOnePath(List<Path> paths, ResultRowMapper.ValueProvider queryResultProvider, RT result, SelectionRegistry rootSelectionRegistry) Called for to-one paths.paths()
-
Method Details
-
paths
-
createInstanceOfResultType
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 pathresult- an instance of the result type for the current rowrootSelectionRegistry- 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. AListas it's a to-many pathresult- an instance of the result type for the current rowrootSelectionRegistry- 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)
-