Class AbstractCriteriaBuilder<QB extends QueryBuilderBase<QB,QW>,QT,QW>
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl<QB,QW>
ch.tocco.nice2.persist.core.impl.hibernate.query.AbstractCriteriaBuilder<QB,QT,QW>
- Type Parameters:
QB
- Type of the actualAbstractCriteriaBuilder
implementation so that it can be returned from the builder methodsQT
- Return type of theCriteriaQuery
queryQW
- Type that should be returned from theQueryBuilderBaseImpl.build()
method
- All Implemented Interfaces:
QueryBuilderBase<QB,
QW>
- Direct Known Subclasses:
CriteriaCountQueryBuilder
,CriteriaDeleteBuilderImpl
,CriteriaQueryBuilderImpl
public abstract class AbstractCriteriaBuilder<QB extends QueryBuilderBase<QB,QW>,QT,QW>
extends QueryBuilderBaseImpl<QB,QW>
An abstract base class for query builders that are based on a
CriteriaQuery
.-
Field Summary
Modifier and TypeFieldDescriptionprotected final CriteriaBuilderWrapper
protected final Map
<String, JdbcFunction> protected final Map
<String, ParameterProvider<?>> protected final PredicateFactory
protected final jakarta.persistence.criteria.CriteriaQuery
<QT> protected final jakarta.persistence.criteria.Root
<?> protected final org.hibernate.Session
protected final PredicateBuilder.SubqueryFactory
Fields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl
collector, conditionFactory, dataModel, fieldResolver, insecureEnabled, interceptors, predicates, queryHints, typeManager
-
Constructor Summary
ConstructorDescriptionAbstractCriteriaBuilder
(org.hibernate.Session session, Class<? extends Entity> entityClass, Class<QT> queryType, List<QueryBuilderInterceptor> interceptors, TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, Map<String, JdbcFunction> jdbcFunctions, Map<String, ParameterProvider<?>> parameterProviders, Map<String, ?> queryHints, InsecureOrderPathsRegistry insecureOrderPathsRegistry) -
Method Summary
Modifier and TypeMethodDescriptionaddParameter
(String name, Object value) If a condition with an explicit parameter expression was added to the query, this method can be used to set the parameter values.protected <T> org.hibernate.query.Query
<T> applyParametersToQuery
(org.hibernate.query.Query<T> q, Map<String, Object> parameters, ParameterCollector collector) protected org.hibernate.query.Query
<QT> createQuery
(jakarta.persistence.criteria.Selection<QT> selection, List<jakarta.persistence.criteria.Order> order) protected PredicateFactory
protected QueryDistinctStrategy
jakarta.persistence.criteria.Root
<?> protected void
logNewQueryError
(String message, Object... messageArgs) Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl
build, doBuild, doInsecure, getPermission, getPredicates, initializationCompleted, self, where, where, where, where, whereInsecure, whereInsecure, whereInsecure
-
Field Details
-
session
protected final org.hibernate.Session session -
criteriaBuilder
-
query
-
queryRoot
protected final jakarta.persistence.criteria.Root<?> queryRoot -
subqueryFactory
-
predicateFactory
-
jdbcFunctions
-
parameterProviders
-
parameters
-
-
Constructor Details
-
AbstractCriteriaBuilder
public AbstractCriteriaBuilder(org.hibernate.Session session, Class<? extends Entity> entityClass, Class<QT> queryType, List<QueryBuilderInterceptor> interceptors, TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, Map<String, JdbcFunction> jdbcFunctions, Map<String, ParameterProvider<?>> parameterProviders, Map<String, ?> queryHints, InsecureOrderPathsRegistry insecureOrderPathsRegistry)
-
-
Method Details
-
getCriteriaBuilder
- Returns:
- the
CriteriaBuilder
that can be used to create conditions that can be passed toQueryBuilderBase.where(Predicate...)
-
getQueryRoot
public jakarta.persistence.criteria.Root<?> getQueryRoot()- Returns:
- the
Root
orJoin
instance that represents the root entity of the query
-
getSubqueryFactory
- Returns:
- an instance of
PredicateBuilder.SubqueryFactory
that can be used to create subqueries
-
getPredicateFactory
- Specified by:
getPredicateFactory
in classQueryBuilderBaseImpl<QB extends QueryBuilderBase<QB,
QW>, QW>
-
addParameter
Description copied from interface:QueryBuilderBase
If a condition with an explicit parameter expression was added to the query, this method can be used to set the parameter values. -
createQuery
-
applyParametersToQuery
protected <T> org.hibernate.query.Query<T> applyParametersToQuery(org.hibernate.query.Query<T> q, Map<String, Object> parameters, ParameterCollector collector) -
getQueryDistinctStrategy
-
logNewQueryError
-