Class ToManySelectionPathHandler
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandler
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.ToManySelectionPathHandler
- All Implemented Interfaces:
- SelectionPathHandler
SelectionPathHandler for all to-many fields (except binaries).
 This handler does not add anything to the query directly - to-many paths would return multiple rows per result, which would
 cause issues with pagination.
 Instead, an additional query is executed to fetch all the to-many values for the results of the primary query.
 One query is executed per 'path-group' (all fields that belong to the same path).- 
Nested Class SummaryNested classes/interfaces inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandlerAbstractToManySelectionPathHandler.QueryHolder
- 
Field SummaryFields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandlercriteriaBuilder, dataModel, fieldResolver, interceptors, parameterProviders, paths, predicateFactory, queries, rootKeyName, rootModel, selectionInterceptorMap, session, typeManager
- 
Constructor SummaryConstructorsConstructorDescriptionToManySelectionPathHandler(DataModel dataModel, TypeManager typeManager, FieldResolver fieldResolver, EntityModel rootModel, PredicateFactory predicateFactory, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidprocessAdditionalQuery(AbstractToManySelectionPathHandler.QueryHolder queryHolder, List<Path> paths) <RT> voidprocessResults(List<Object[]> queryResults, List<RT> target, SelectionRegistry selectionRegistry, ResultRowMapper<RT> mapper) This is called after the query was executed.voidbooleanAll to-many fields except binaries are supported.Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.selection.AbstractToManySelectionPathHandlerdoLoadData, extractAllRootPrimaryKeys, processSelection
- 
Constructor Details- 
ToManySelectionPathHandlerpublic ToManySelectionPathHandler(DataModel dataModel, TypeManager typeManager, FieldResolver fieldResolver, EntityModel rootModel, PredicateFactory predicateFactory, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder) 
 
- 
- 
Method Details- 
supportsAll to-many fields except binaries are supported.- Returns:
- true if this instance supports the given path.
 
- 
select- Parameters:
- path- a path that should be selected by this handler.
 
- 
processAdditionalQueryprotected void processAdditionalQuery(AbstractToManySelectionPathHandler.QueryHolder queryHolder, List<Path> paths) - Specified by:
- processAdditionalQueryin class- AbstractToManySelectionPathHandler
 
- 
processResultspublic <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.- Parameters:
- queryResults- the query result, contains all paths added during- SelectionPathHandler.processSelection(SelectionRegistry)
- target- the list of arrays that will be returned from the query builder
 
 
-