Class ToOneSelectionPathHandler
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.ToOneSelectionPathHandler
- All Implemented Interfaces:
SelectionPathHandler
SelectionPathHandler for all to-one fields (except binaries).
All fields can be queried directly from the database (see processSelection(SelectionRegistry)).
In addition the primary key of each path is queried as well, in order to be able to check field-level security.
The temporary results can then be simply be mapped to the target array (see processResults(List, List, SelectionRegistry, ResultRowMapper)).
Before the values are mapped to the target, the interceptors are invoked so that they can modify the result if necessary.-
Constructor Summary
ConstructorsConstructorDescriptionToOneSelectionPathHandler(EntityModel rootModel, List<QueryBuilderInterceptor> interceptors) -
Method Summary
Modifier and TypeMethodDescription<RT> voidprocessResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.voidprocessSelection(SelectionRegistry selectionRegistry) This is called before the query is executed.voidbooleanAll to-one fields except binaries are supported.
-
Constructor Details
-
ToOneSelectionPathHandler
-
-
Method Details
-
supports
All to-one fields except binaries are supported.- Specified by:
supportsin interfaceSelectionPathHandler- Returns:
- true if this instance supports the given path.
-
select
- Specified by:
selectin interfaceSelectionPathHandler- Parameters:
path- a path that should be selected by this handler.
-
processSelection
Description copied from interface:SelectionPathHandlerThis is called before the query is executed. The handler can add all required selection paths to the givenSelectionRegistry.- Specified by:
processSelectionin interfaceSelectionPathHandler
-
processResults
public <RT> void processResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) Description copied from interface:SelectionPathHandlerThis is called after the query was executed. The handler is expected to map the query results to the target array that is returned from the query builder.- Specified by:
processResultsin interfaceSelectionPathHandler- Parameters:
queryResults- the query result, contains all paths added duringSelectionPathHandler.processSelection(SelectionRegistry)target- the list of arrays that will be returned from the query builder
-