Class CustomSelection
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.selection.CustomSelection
Class to be used to specify a custom selection for a
CriteriaQueryBuilder
.-
Constructor Summary
ConstructorDescriptionCustomSelection
(BinaryDataAccessor binaryDataAccessor, TypeManager typeManager, FieldResolver fieldResolver, DataModel dataModel, EntityModel rootModel, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, PredicateFactory predicateFactory, ParameterCollector parameterCollector, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder, jakarta.persistence.criteria.Root<?> queryRoot) -
Method Summary
Modifier and TypeMethodDescriptionAdd a path that should be selected from the query.<RT> void
mapResults
(List<RT> target, List<Object[]> queryResult, ResultRowMapper<RT> mapper) int
void
setToManyPathResultLimit
(int limit) jakarta.persistence.criteria.Selection
<?> Combine all selected paths into a JPASelection
instance.
-
Constructor Details
-
CustomSelection
public CustomSelection(BinaryDataAccessor binaryDataAccessor, TypeManager typeManager, FieldResolver fieldResolver, DataModel dataModel, EntityModel rootModel, List<QueryBuilderInterceptor> interceptors, Map<String, ParameterProvider<?>> parameterProviders, PredicateFactory predicateFactory, ParameterCollector parameterCollector, org.hibernate.Session session, CriteriaBuilderWrapper criteriaBuilder, jakarta.persistence.criteria.Root<?> queryRoot)
-
-
Method Details
-
addPath
Add a path that should be selected from the query. The path can be nested or point to a to-many field. For example: - 'firstname' - 'relAddress.street' - 'relAddress.relType.unique_id' - 'relUser' -
toJpaSelection
public jakarta.persistence.criteria.Selection<?> toJpaSelection()Combine all selected paths into a JPASelection
instance. -
numberOfSelectedPaths
public int numberOfSelectedPaths() -
mapResults
public <RT> void mapResults(List<RT> target, List<Object[]> queryResult, ResultRowMapper<RT> mapper) -
setToManyPathResultLimit
public void setToManyPathResultLimit(int limit)
-