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
ConstructorDescriptionToOneSelectionPathHandler
(EntityModel rootModel, List<QueryBuilderInterceptor> interceptors) -
Method Summary
Modifier and TypeMethodDescription<RT> void
processResults
(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.void
processSelection
(SelectionRegistry selectionRegistry) This is called before the query is executed.void
boolean
All to-one fields except binaries are supported.
-
Constructor Details
-
ToOneSelectionPathHandler
-
-
Method Details
-
supports
All to-one fields except binaries are supported.- Specified by:
supports
in interfaceSelectionPathHandler
- Returns:
- true if this instance supports the given path.
-
select
- Specified by:
select
in interfaceSelectionPathHandler
- Parameters:
path
- a path that should be selected by this handler.
-
processSelection
Description copied from interface:SelectionPathHandler
This is called before the query is executed. The handler can add all required selection paths to the givenSelectionRegistry
.- Specified by:
processSelection
in interfaceSelectionPathHandler
-
processResults
public <RT> void processResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) Description copied from interface:SelectionPathHandler
This 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:
processResults
in 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
-