Class QueryBuilderBaseImpl<QB extends QueryBuilderBase<QB,QW>,QW>
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.QueryBuilderBaseImpl<QB,QW>
- Type Parameters:
QB
- Type of the actualQueryBuilderBase
implementation so that it can be returned from the builder methodsQW
- Type that should be returned from thebuild()
method
- All Implemented Interfaces:
QueryBuilderBase<QB,
QW>
- Direct Known Subclasses:
AbstractCriteriaBuilder
,SubqueryBuilderImpl
public abstract class QueryBuilderBaseImpl<QB extends QueryBuilderBase<QB,QW>,QW>
extends Object
implements QueryBuilderBase<QB,QW>
Base class for query builders.
Manages a list of
Predicate
instances, which can be added in the form of a Predicate
, a PredicateBuilder
,
a Node
or a Condition
.
When QueryBuilderBase.build()
is called finalize the query, the QueryBuilderInterceptor
are called.-
Field Summary
Modifier and TypeFieldDescriptionprotected final ParameterCollector
protected final ConditionFactory
protected final DataModel
protected final FieldResolver
protected final AtomicBoolean
protected final List
<QueryBuilderInterceptor> protected final List
<jakarta.persistence.criteria.Predicate> protected final TypeManager
-
Constructor Summary
ConstructorDescriptionQueryBuilderBaseImpl
(TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, List<QueryBuilderInterceptor> interceptors, Map<String, ?> queryHints) QueryBuilderBaseImpl
(TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, List<QueryBuilderInterceptor> interceptors, Map<String, ?> queryHints, ParameterCollector parameterCollector, AtomicBoolean insecureEnabled) -
Method Summary
Modifier and TypeMethodDescriptionfinal QW
build()
This method should be called when the query configuration is complete.protected abstract QW
doBuild()
protected <T> T
doInsecure
(Supplier<T> supplier) protected abstract QueryBuilderInterceptor.QueryBuilderType
protected abstract PredicateFactory
List
<jakarta.persistence.criteria.Predicate> protected final void
protected abstract QB
self()
where
(PredicateBuilder predicateBuilder) where
(jakarta.persistence.criteria.Predicate... predicates) whereInsecure
(Node condition) Conditions added through this method are *not* decorated with any security conditions.whereInsecure
(PredicateBuilder predicateBuilder) whereInsecure
(Condition... condition) Conditions added through this method are *not* decorated with any security conditions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.hibernate.query.builder.QueryBuilderBase
addParameter, getCriteriaBuilder, getQueryRoot, getSubqueryFactory
-
Field Details
-
typeManager
-
dataModel
-
conditionFactory
-
fieldResolver
-
collector
-
interceptors
-
predicates
-
queryHints
-
insecureEnabled
-
-
Constructor Details
-
QueryBuilderBaseImpl
public QueryBuilderBaseImpl(TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, List<QueryBuilderInterceptor> interceptors, Map<String, ?> queryHints) -
QueryBuilderBaseImpl
public QueryBuilderBaseImpl(TypeManager typeManager, DataModel dataModel, ConditionFactory conditionFactory, FieldResolver fieldResolver, List<QueryBuilderInterceptor> interceptors, Map<String, ?> queryHints, ParameterCollector parameterCollector, AtomicBoolean insecureEnabled)
-
-
Method Details
-
getPermission
-
getPredicateFactory
-
where
- Specified by:
where
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
whereInsecure
- Specified by:
whereInsecure
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
where
- Specified by:
where
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
where
- Specified by:
where
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
whereInsecure
Description copied from interface:QueryBuilderBase
Conditions added through this method are *not* decorated with any security conditions. User supplied conditions should never be passed to this method.- Specified by:
whereInsecure
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
where
- Specified by:
where
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
whereInsecure
Description copied from interface:QueryBuilderBase
Conditions added through this method are *not* decorated with any security conditions. User supplied conditions should never be passed to this method.- Specified by:
whereInsecure
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW>
-
doInsecure
-
getPredicates
- Specified by:
getPredicates
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW> - Returns:
- all conditions of the query
-
self
-
initializationCompleted
protected final void initializationCompleted() -
build
Description copied from interface:QueryBuilderBase
This method should be called when the query configuration is complete.QueryBuilderInterceptor
are also called at this point.- Specified by:
build
in interfaceQueryBuilderBase<QB extends QueryBuilderBase<QB,
QW>, QW> - Returns:
- an object that allows to access the query results
-
doBuild
-