Class SelectionRegistry
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.SelectionRegistry
A registry for a 
. These
 are the results that will be returned from the 
CustomSelection which tracks the following two things:
 - at which position the user expects the paths that were added through 
invalid reference
CustomSelection#addPath(String...)CriteriaQueryBuilder and may contain to-many paths
 - the position of paths that are actually part of the main query. This is not equal to the paths requested by the user,
 as for example to-many paths are evaluated separately (see SelectionPathHandler implementations) and some additional
 data is queried as well in order to check access security.
 This class also makes sure that no path is queried twice. If it is required by multiple paths, it will be only queried once
 and then mapped to the correct index.- 
Constructor SummaryConstructorsConstructorDescriptionSelectionRegistry(FieldResolver fieldResolver, jakarta.persistence.criteria.Root<?> queryRoot, org.hibernate.Session session, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, ParameterCollector parameterCollector) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddQueryPath(Path path) Add a path to the selection of the main query; these paths will be available in the temporary resultvoidaddResultPath(Path path, int index) Add a path (and its position in the array) that should be returned from theCriteriaQueryBuilderImplprotected jakarta.persistence.criteria.From<?, ?> findSelectionRoot(String path, jakarta.persistence.criteria.Root<?> queryRoot, ParameterCollector parameterCollector) Finds theJoin(orRoot) instance that is represented by the given path (the last path element).booleanhasQueryPath(Path path) intindexOfQueryPath(Path path) intindexOfResultPath(Path path) intjakarta.persistence.criteria.Selection<Object[]> 
- 
Constructor Details- 
SelectionRegistrypublic SelectionRegistry(FieldResolver fieldResolver, jakarta.persistence.criteria.Root<?> queryRoot, org.hibernate.Session session, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, ParameterCollector parameterCollector) 
 
- 
- 
Method Details- 
addResultPathAdd a path (and its position in the array) that should be returned from theCriteriaQueryBuilderImpl
- 
indexOfResultPath- Returns:
- position of a given result path in the result array
 
- 
numberOfResultPathspublic int numberOfResultPaths()- Returns:
- number of selected result paths (i.e the size of the resulting array per row)
 
- 
addQueryPathAdd a path to the selection of the main query; these paths will be available in the temporary result
- 
hasQueryPath
- 
indexOfQueryPath- Returns:
- position of a given query path in the temporary result
 
- 
toSelection- Returns:
- a Selectioninstance that contains all the query paths contained in this registry
 
- 
findSelectionRootprotected jakarta.persistence.criteria.From<?,?> findSelectionRoot(String path, jakarta.persistence.criteria.Root<?> queryRoot, ParameterCollector parameterCollector) Finds theJoin(orRoot) instance that is represented by the given path (the last path element). An empty string represents the query root. Note: the path may not contain a field at the end (fields are handled by the subclasses)!
 
-