Package com.blazebit.persistence
Interface CriteriaBuilder<T>
- Type Parameters:
T
- The query result type
- All Superinterfaces:
BaseCriteriaBuilder<T,CriteriaBuilder<T>>
,BaseHavingBuilder<CriteriaBuilder<T>>
,BaseQueryBuilder<T,CriteriaBuilder<T>>
,BaseWhereBuilder<CriteriaBuilder<T>>
,CommonQueryBuilder<CriteriaBuilder<T>>
,ConfigurationSource
,CorrelationQueryBuilder<CriteriaBuilder<T>>
,CTEBuilder<CriteriaBuilder<T>>
,DistinctBuilder<CriteriaBuilder<T>>
,FetchBuilder<CriteriaBuilder<T>>
,FromBaseBuilder<CriteriaBuilder<T>>
,FromBuilder<CriteriaBuilder<T>>
,FromProvider
,FullQueryBuilder<T,CriteriaBuilder<T>>
,GroupByBuilder<CriteriaBuilder<T>>
,HavingBuilder<CriteriaBuilder<T>>
,KeysetQueryBuilder<CriteriaBuilder<T>>
,LimitBuilder<CriteriaBuilder<T>>
,OrderByBuilder<CriteriaBuilder<T>>
,ParameterHolder<CriteriaBuilder<T>>
,Queryable<T,CriteriaBuilder<T>>
,QueryBuilder<T,CriteriaBuilder<T>>
,SelectBuilder<CriteriaBuilder<T>>
,ServiceProvider
,SetOperationBuilder<LeafOngoingSetOperationCriteriaBuilder<T>,StartOngoingSetOperationCriteriaBuilder<T,LeafOngoingFinalSetOperationCriteriaBuilder<T>>>
,WhereBuilder<CriteriaBuilder<T>>
,WindowContainerBuilder<CriteriaBuilder<T>>
public interface CriteriaBuilder<T> extends FullQueryBuilder<T,CriteriaBuilder<T>>, BaseCriteriaBuilder<T,CriteriaBuilder<T>>, CTEBuilder<CriteriaBuilder<T>>, SetOperationBuilder<LeafOngoingSetOperationCriteriaBuilder<T>,StartOngoingSetOperationCriteriaBuilder<T,LeafOngoingFinalSetOperationCriteriaBuilder<T>>>
A builder for criteria queries. This is the entry point for building queries.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description <Y> CriteriaBuilder<Y>
copy(Class<Y> resultClass)
Copies this query builder into a new one, using it's projection as an overridable default.javax.persistence.TypedQuery<Long>
getQueryRootCountQuery()
Returns a query that counts the distinct query root results that would be produced if the current query was run.javax.persistence.TypedQuery<Long>
getQueryRootCountQuery(long maximumCount)
Returns a query that counts the distinct query root results and counts up to the maximum value that is given that would be produced if the current query was run.String
getQueryRootCountQueryString()
Returns the query string that selects the distinct count of query root elements.String
getQueryRootCountQueryString(long maximumCount)
Returns the query string that selects the distinct count of query root elements and counts up to the maximum value that is given.<Y> CriteriaBuilder<Y>
selectNew(ObjectBuilder<Y> builder)
Applies the given object builder to this query.<Y> SelectObjectBuilder<CriteriaBuilder<Y>>
selectNew(Class<Y> clazz)
Starts aSelectObjectBuilder
for the given class.Methods inherited from interface com.blazebit.persistence.BaseHavingBuilder
having, havingCase, havingExists, havingExists, havingExpression, havingExpressionSubqueries, havingNotExists, havingNotExists, havingSimpleCase, havingSubqueries, havingSubquery, havingSubquery, havingSubquery, havingSubquery
Methods inherited from interface com.blazebit.persistence.BaseWhereBuilder
where, whereCase, whereExists, whereExists, whereExpression, whereExpressionSubqueries, whereNotExists, whereNotExists, whereSimpleCase, whereSubqueries, whereSubquery, whereSubquery, whereSubquery, whereSubquery
Methods inherited from interface com.blazebit.persistence.CommonQueryBuilder
getCriteriaBuilderFactory, getMetamodel, isCacheable, registerMacro, setCacheable, setProperties, setProperty
Methods inherited from interface com.blazebit.persistence.spi.ConfigurationSource
getProperties, getProperty
Methods inherited from interface com.blazebit.persistence.CTEBuilder
hasCte, with, with, with, with, withCtesFrom, withRecursive, withReturning, withStartSet, withStartSet
Methods inherited from interface com.blazebit.persistence.FromBaseBuilder
fromEntitySubquery, fromEntitySubquery, fromEntitySubquery, fromSubquery, fromSubquery
Methods inherited from interface com.blazebit.persistence.FromBuilder
from, from, from, from, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromIdentifiableValues, fromNew, fromNew, fromOld, fromOld, fromValues, fromValues, fromValues, fromValues, getFrom, getFromByPath, getPath, getRoots, innerJoin, innerJoinDefault, innerJoinDefaultOn, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnEntitySubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralOnSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinLateralSubquery, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOn, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnEntitySubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, innerJoinOnSubquery, join, joinDefault, joinDefaultOn, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnEntitySubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralOnSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinLateralSubquery, joinOn, joinOn, joinOn, joinOn, joinOn, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnEntitySubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, joinOnSubquery, leftJoin, leftJoinDefault, leftJoinDefaultOn, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnEntitySubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralOnSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinLateralSubquery, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOn, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnEntitySubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, leftJoinOnSubquery, rightJoin, rightJoinDefault, rightJoinDefaultOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOn, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnEntitySubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery, rightJoinOnSubquery
Methods inherited from interface com.blazebit.persistence.FullQueryBuilder
createPageIdQuery, createPageIdQuery, createPageIdQuery, createPageIdQuery, getCountQuery, getCountQuery, getCountQueryString, getCountQueryString, innerJoinFetch, innerJoinFetchDefault, join, joinDefault, leftJoinFetch, leftJoinFetchDefault, page, page, page, pageAndNavigate, pageBy, pageBy, pageBy, pageBy, pageByAndNavigate, pageByAndNavigate, rightJoinFetch, rightJoinFetchDefault, selectNew
Methods inherited from interface com.blazebit.persistence.GroupByBuilder
groupBy, groupBy, groupByCube, groupByCube, groupByGroupingSets, groupByRollup, groupByRollup
Methods inherited from interface com.blazebit.persistence.HavingBuilder
havingOr, setHavingExpression, setHavingExpressionSubqueries
Methods inherited from interface com.blazebit.persistence.KeysetQueryBuilder
afterKeyset, afterKeyset, afterKeyset, beforeKeyset, beforeKeyset, beforeKeyset
Methods inherited from interface com.blazebit.persistence.LimitBuilder
getFirstResult, getMaxResults, setFirstResult, setMaxResults
Methods inherited from interface com.blazebit.persistence.OrderByBuilder
orderBy, orderBy, orderByAsc, orderByAsc, orderByDesc, orderByDesc
Methods inherited from interface com.blazebit.persistence.ParameterHolder
containsParameter, getParameter, getParameters, getParameterValue, isParameterSet, setParameter, setParameter, setParameter, setParameterType
Methods inherited from interface com.blazebit.persistence.Queryable
getQuery, getQueryString, getResultList, getSingleResult
Methods inherited from interface com.blazebit.persistence.SelectBuilder
select, select, selectCase, selectCase, selectSimpleCase, selectSimpleCase, selectSubqueries, selectSubqueries, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery, selectSubquery
Methods inherited from interface com.blazebit.persistence.SetOperationBuilder
except, exceptAll, intersect, intersectAll, startExcept, startExceptAll, startIntersect, startIntersectAll, startUnion, startUnionAll, union, unionAll
Methods inherited from interface com.blazebit.persistence.WhereBuilder
setWhereExpression, setWhereExpressionSubqueries, whereOr
-
Method Details
-
getQueryRootCountQuery
javax.persistence.TypedQuery<Long> getQueryRootCountQuery()Returns a query that counts the distinct query root results that would be produced if the current query was run.- Returns:
- A query for determining the count of the distinct query root result list represented by this query builder
- Since:
- 1.3.0
-
getQueryRootCountQueryString
String getQueryRootCountQueryString()Returns the query string that selects the distinct count of query root elements.- Returns:
- The query string
- Since:
- 1.3.0
-
getQueryRootCountQuery
Returns a query that counts the distinct query root results and counts up to the maximum value that is given that would be produced if the current query was run.- Parameters:
maximumCount
- the maximum value up to which should be counted- Returns:
- A query for determining the count of the distinct query root result list represented by this query builder
- Since:
- 1.5.0
-
getQueryRootCountQueryString
Returns the query string that selects the distinct count of query root elements and counts up to the maximum value that is given.- Parameters:
maximumCount
- the maximum value up to which should be counted- Returns:
- The query string
- Since:
- 1.5.0
-
copy
Description copied from interface:FullQueryBuilder
Copies this query builder into a new one, using it's projection as an overridable default.- Specified by:
copy
in interfaceFullQueryBuilder<T,CriteriaBuilder<T>>
- Type Parameters:
Y
- The type of the result class- Parameters:
resultClass
- The result class of the query- Returns:
- A new query builder
-
selectNew
Description copied from interface:FullQueryBuilder
Starts aSelectObjectBuilder
for the given class. The types of the parameter arguments used in theSelectObjectBuilder
must match a constructor of the given class.- Specified by:
selectNew
in interfaceFullQueryBuilder<T,CriteriaBuilder<T>>
- Type Parameters:
Y
- The new query result type specified by the given class- Parameters:
clazz
- The class which should be used for the select new select clause- Returns:
- The select object builder for the given class
-
selectNew
Description copied from interface:FullQueryBuilder
Applies the given object builder to this query. The object builder provides the select clauses and is used to transform the result set tuples.- Specified by:
selectNew
in interfaceFullQueryBuilder<T,CriteriaBuilder<T>>
- Type Parameters:
Y
- The new query result type specified by the given class- Parameters:
builder
- The object builder which transforms the result set into objects of typeY
- Returns:
- The query builder for chaining calls
-