Interface JpaCriteriaQuery<T>
- All Superinterfaces:
AbstractQuery<T>, CommonAbstractCriteria, CriteriaQuery<T>, CriteriaSelect<T>, JpaCriteriaBase, JpaCriteriaNode, JpaCriteriaSelect<T>, JpaCteContainer, JpaQueryableCriteria<T>, JpaSelectCriteria<T>, Serializable
- All Known Implementing Classes:
CriteriaDefinition, SqmSelectStatement
public interface JpaCriteriaQuery<T>
extends CriteriaQuery<T>, JpaQueryableCriteria<T>, JpaSelectCriteria<T>, JpaCriteriaSelect<T>
Extension of the JPA
CriteriaQuery-
Method Summary
Modifier and TypeMethodDescriptionA query that returns the number of results of this query.A query that returnstrueif this query has any results.distinct(boolean distinct) Set whether duplicate query results are eliminated.Set the query fetch limit.fetch(Number fetch, FetchClauseType fetchClauseType) Set the query fetch limit.fetch(JpaExpression<? extends Number> fetch) Set the query fetch limit.fetch(JpaExpression<? extends Number> fetch, FetchClauseType fetchClauseType) Set the query fetch limit.<X> JpaRoot<X> from(EntityType<X> entity) Create a query root for the given entity type.<X> JpaRoot<X> Create a query root for the given entity type.Return the criteria builder that created this query.getFetch()Return the query fetch expression.Return the fetch clause type.Return the query offset expression.<E> JpaRoot<? extends E> Get a query root element at the given position with the given type.<E> JpaRoot<? extends E> Get a query root element with the given alias and the given type.Return the roots as a list.groupBy(Expression<?>... grouping) Set the grouping expressions.groupBy(List<Expression<?>> grouping) Set the grouping expressions.having(BooleanExpression... restrictions) Set the group restriction.having(Expression<Boolean> restriction) Set the group restriction.having(List<? extends Expression<Boolean>> restrictions) Set the group restriction.multiselect(Selection<?>... selections) Deprecated.multiselect(List<Selection<?>> selectionList) Deprecated.Set the query offset.offset(JpaExpression<? extends Number> offset) Set the query offset.Set the ordering expressions.Set the ordering expressions.Set the query selection.<U> JpaSubQuery<U> subquery(EntityType<U> type) Create a subquery for the given entity type.where(BooleanExpression... restrictions) Set the restriction.where(Expression<Boolean> restriction) Set the restriction.where(List<? extends Expression<Boolean>> restrictions) Set the restriction.Methods inherited from interface AbstractQuery
getGroupList, getResultType, getRoots, isDistinctMethods inherited from interface CriteriaQuery
getOrderListMethods inherited from interface JpaCriteriaBase
subqueryMethods inherited from interface JpaCteContainer
getCteCriteria, getCteCriterias, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinctMethods inherited from interface JpaSelectCriteria
from, from, from, getGroupRestriction, getQueryPart, getQuerySpec, getRestriction, getSelection
-
Method Details
-
createCountQuery
A query that returns the number of results of this query.- Since:
- 6.4
- See Also:
-
createExistsQuery
A query that returnstrueif this query has any results.- Since:
- 7.1
-
getOffset
Return the query offset expression. -
offset
Set the query offset. -
offset
Set the query offset. -
getFetch
Return the query fetch expression. -
fetch
Set the query fetch limit. -
fetch
@Nonnull JpaCriteriaQuery<T> fetch(@Nullable JpaExpression<? extends Number> fetch, @Nonnull FetchClauseType fetchClauseType) Set the query fetch limit. -
fetch
Set the query fetch limit. -
fetch
@Nonnull JpaCriteriaQuery<T> fetch(@Nullable Number fetch, @Nonnull FetchClauseType fetchClauseType) Set the query fetch limit. -
getFetchClauseType
Return the fetch clause type. -
getRootList
Return the roots as a list.- Specified by:
getRootListin interfaceAbstractQuery<T>
-
getRoot
Get a query root element at the given position with the given type.- Parameters:
position- the position of this root elementtype- the type of the root entity- Throws:
IllegalArgumentException- if the root entity at the given position is not of the given type, or if there are not enough root entities in the query
-
getRoot
Get a query root element with the given alias and the given type.- Parameters:
alias- the identification variable of the root elementtype- the type of the root entity- Throws:
IllegalArgumentException- if the root entity with the given alias is not of the given type, or if there is no root entities with the given alias
-
getParameters
- Specified by:
getParametersin interfaceCommonAbstractCriteria- API Note:
- Warning! This actually walks the criteria tree looking for parameters nodes.
-
from
Create a query root for the given entity type.- Specified by:
fromin interfaceAbstractQuery<T>- Specified by:
fromin interfaceJpaSelectCriteria<T>
-
from
Create a query root for the given entity type.- Specified by:
fromin interfaceAbstractQuery<T>- Specified by:
fromin interfaceJpaSelectCriteria<T>
-
distinct
Set whether duplicate query results are eliminated.- Specified by:
distinctin interfaceAbstractQuery<T>- Specified by:
distinctin interfaceCriteriaQuery<T>- Specified by:
distinctin interfaceJpaSelectCriteria<T>
-
select
Set the query selection.- Specified by:
selectin interfaceCriteriaQuery<T>
-
multiselect
Deprecated.Set the compound query selection.- Specified by:
multiselectin interfaceCriteriaQuery<T>
-
multiselect
Deprecated.Set the compound query selection.- Specified by:
multiselectin interfaceCriteriaQuery<T>
-
where
Set the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>
-
where
Set the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>
-
where
Set the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>
-
groupBy
Set the grouping expressions.- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceCriteriaQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>
-
groupBy
Set the grouping expressions.- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceCriteriaQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>
-
having
Set the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>
-
having
Set the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>
-
having
Set the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>
-
orderBy
Set the ordering expressions.- Specified by:
orderByin interfaceCriteriaQuery<T>
-
orderBy
Set the ordering expressions.- Specified by:
orderByin interfaceCriteriaQuery<T>
-
subquery
Create a subquery for the given entity type.- Specified by:
subqueryin interfaceCommonAbstractCriteria
-
getCriteriaBuilder
Return the criteria builder that created this query.
-