Class SqmSelectStatement<T>
java.lang.Object
org.hibernate.query.sqm.tree.spi.AbstractSqmNode
org.hibernate.query.sqm.tree.spi.select.AbstractSqmSelectQuery<T>
org.hibernate.query.sqm.tree.spi.select.SqmSelectStatement<T>
- All Implemented Interfaces:
AbstractQuery<T>, CommonAbstractCriteria, CriteriaQuery<T>, CriteriaSelect<T>, Serializable, JpaCriteriaBase, JpaCriteriaNode, JpaCriteriaQuery<T>, JpaCriteriaSelect<T>, JpaCteContainer, JpaQueryableCriteria<T>, JpaSelectCriteria<T>, org.hibernate.query.sqm.internal.ParameterCollector, SqmCteContainer, SqmSelectQuery<T>, SqmCacheable, SqmNode, SqmQuery<T>, SqmStatement<T>, SqmVisitableNode
public class SqmSelectStatement<T>
extends AbstractSqmSelectQuery<T>
implements JpaCriteriaQuery<T>, SqmStatement<T>, org.hibernate.query.sqm.internal.ParameterCollector
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface SqmStatement
SqmStatement.ParameterResolutions -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmSelectStatement(Class<T> resultJavaType, NodeBuilder nodeBuilder) SqmSelectStatement(Class<T> resultJavaType, SqmQuerySource querySource, NodeBuilder nodeBuilder) SqmSelectStatement(NodeBuilder nodeBuilder) SqmSelectStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder) SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, Map<String, SqmCteStatement<?>> cteStatements, SqmQuerySource querySource, NodeBuilder builder) SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, SqmQuerySource querySource, NodeBuilder builder) SqmSelectStatement(SqmSelectStatement<T> original) SqmSelectStatement(SqmSelectStatement<T> original, Class<T> resultType) -
Method Summary
Modifier and TypeMethodDescription<X> Xaccept(SemanticQueryWalker<X> walker) Accept the walker per visitationvoidaddParameter(SqmParameter<?> parameter) booleancopy(SqmCopyContext context) <X> SqmSelectStatement<X> createCopy(SqmCopyContext context, Class<X> resultType) A 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.Return the criteria builder that created this query.getFetch()Return the query fetch expression.Return the fetch clause type.Return the query offset expression.The query structure.Set<SqmParameter<?>> Access to the (potentially still growing) collection of parameters for the statement.groupBy(Expression<?>... expressions) Set the grouping expressions.groupBy(List<Expression<?>> grouping) Set the grouping expressions.having(BooleanExpression... restrictions) Set the group restriction.having(Expression<Boolean> booleanExpression) 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.booleanSet the query selection.<U> SqmSubQuery<U> subquery(EntityType<U> type) Create a subquery for the given entity type.<U> SqmSubQuery<U> Create a subquery with the given result type.booleanvoidvalidateResultType(Class<?> resultType) where(BooleanExpression... restrictions) Set the restriction.where(Expression<Boolean> restriction) Set the restriction.where(List<? extends Expression<Boolean>> restrictions) Set the restriction.protected <X> JpaCteCriteria<X> withInternal(String name, AbstractQuery<X> criteria) protected <X> JpaCteCriteria<X> withInternal(String name, AbstractQuery<X> baseCriteria, boolean unionDistinct, Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) Methods inherited from class AbstractSqmSelectQuery
appendHqlString, cacheHashCode, copyCteStatements, equals, from, from, from, from, from, getCteCriteria, getCteCriterias, getCteStatement, getCteStatements, getGroupList, getGroupRestriction, getQueryPart, getRestriction, getResultSelection, getResultType, getRoot, getRoot, getRootList, getRoots, getSelection, hashCode, isCompatible, isDistinct, setQueryPart, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinctMethods inherited from class AbstractSqmNode
nodeBuilderMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AbstractQuery
getGroupList, getResultType, getRoots, isDistinctMethods inherited from interface JpaCriteriaQuery
from, from, getRoot, getRoot, getRootListMethods inherited from interface JpaCteContainer
getCteCriteria, getCteCriterias, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinctMethods inherited from interface JpaSelectCriteria
from, from, from, getGroupRestriction, getRestriction, getSelectionMethods inherited from interface SqmCacheable
cacheHashCode, isCompatibleMethods inherited from interface SqmNode
asLoggableText, nodeBuilderMethods inherited from interface SqmVisitableNode
appendHqlString, toHqlString
-
Constructor Details
-
SqmSelectStatement
-
SqmSelectStatement
-
SqmSelectStatement
public SqmSelectStatement(@Nonnull Class<T> resultJavaType, @Nonnull SqmQuerySource querySource, @Nonnull NodeBuilder nodeBuilder) -
SqmSelectStatement
public SqmSelectStatement(@Nonnull SqmQueryPart<T> queryPart, @Nonnull Class<T> resultType, @Nonnull SqmQuerySource querySource, @Nonnull NodeBuilder builder) -
SqmSelectStatement
public SqmSelectStatement(@Nonnull SqmQueryPart<T> queryPart, @Nonnull Class<T> resultType, @Nonnull Map<String, SqmCteStatement<?>> cteStatements, @Nonnull SqmQuerySource querySource, @Nonnull NodeBuilder builder) -
SqmSelectStatement
- Implementation Note:
- This form is used from the criteria query API.
-
SqmSelectStatement
- Implementation Note:
- This form is used when transforming HQL to criteria. All it does is change the SqmQuerySource to CRITERIA in order to allow correct parameter handing.
-
SqmSelectStatement
-
-
Method Details
-
copy
-
createCopy
@Nonnull @Internal public <X> SqmSelectStatement<X> createCopy(@Nonnull SqmCopyContext context, @Nonnull Class<X> resultType) -
validateResultType
-
getCriteriaBuilder
Description copied from interface:JpaCriteriaQueryReturn the criteria builder that created this query.- Specified by:
getCriteriaBuilderin interfaceJpaCriteriaQuery<T>
-
getOrderList
- Specified by:
getOrderListin interfaceCriteriaQuery<T>
-
getQuerySource
- Specified by:
getQuerySourcein interfaceSqmStatement<T>
-
getQuerySpec
Description copied from interface:JpaSelectCriteriaThe query structure. SeeJpaQueryStructurefor details- Specified by:
getQuerySpecin interfaceJpaSelectCriteria<T>- Specified by:
getQuerySpecin interfaceSqmSelectQuery<T>- Overrides:
getQuerySpecin classAbstractSqmSelectQuery<T>
-
producesUniqueResults
public boolean producesUniqueResults() -
containsCollectionFetches
public boolean containsCollectionFetches() -
usesDistinct
public boolean usesDistinct() -
getSqmParameters
Description copied from interface:SqmStatementAccess to the (potentially still growing) collection of parameters for the statement.- Specified by:
getSqmParametersin interfaceSqmStatement<T>
-
resolveParameters
- Specified by:
resolveParametersin interfaceSqmStatement<T>
-
accept
Description copied from interface:SqmVisitableNodeAccept the walker per visitation- Specified by:
acceptin interfaceSqmVisitableNode
-
addParameter
- Specified by:
addParameterin interfaceorg.hibernate.query.sqm.internal.ParameterCollector
-
withInternal
@Nonnull protected <X> JpaCteCriteria<X> withInternal(@Nonnull String name, @Nonnull AbstractQuery<X> criteria) - Overrides:
withInternalin classAbstractSqmSelectQuery<T>
-
withInternal
@Nonnull protected <X> JpaCteCriteria<X> withInternal(@Nonnull String name, @Nonnull AbstractQuery<X> baseCriteria, boolean unionDistinct, @Nonnull Function<JpaCteCriteria<X>, AbstractQuery<X>> recursiveCriteriaProducer) - Overrides:
withInternalin classAbstractSqmSelectQuery<T>
-
distinct
Description copied from interface:JpaSelectCriteriaSet whether duplicate query results are eliminated.- Specified by:
distinctin interfaceAbstractQuery<T>- Specified by:
distinctin interfaceCriteriaQuery<T>- Specified by:
distinctin interfaceJpaCriteriaQuery<T>- Specified by:
distinctin interfaceJpaSelectCriteria<T>- Specified by:
distinctin interfaceSqmSelectQuery<T>- Overrides:
distinctin classAbstractSqmSelectQuery<T>
-
getParameters
Description copied from interface:JpaCriteriaQuery- Specified by:
getParametersin interfaceCommonAbstractCriteria- Specified by:
getParametersin interfaceJpaCriteriaQuery<T>
-
subquery
Description copied from interface:JpaCriteriaQueryCreate a subquery for the given entity type.- Specified by:
subqueryin interfaceCommonAbstractCriteria- Specified by:
subqueryin interfaceJpaCriteriaQuery<T>
-
select
Description copied from interface:JpaCriteriaQuerySet the query selection.- Specified by:
selectin interfaceCriteriaQuery<T>- Specified by:
selectin interfaceJpaCriteriaQuery<T>
-
multiselect
Deprecated.Description copied from interface:JpaCriteriaQuerySet the compound query selection.- Specified by:
multiselectin interfaceCriteriaQuery<T>- Specified by:
multiselectin interfaceJpaCriteriaQuery<T>
-
multiselect
@Nonnull @Deprecated public SqmSelectStatement<T> multiselect(@Nonnull List<Selection<?>> selectionList) Deprecated.Description copied from interface:JpaCriteriaQuerySet the compound query selection.- Specified by:
multiselectin interfaceCriteriaQuery<T>- Specified by:
multiselectin interfaceJpaCriteriaQuery<T>
-
orderBy
Description copied from interface:JpaCriteriaQuerySet the ordering expressions.- Specified by:
orderByin interfaceCriteriaQuery<T>- Specified by:
orderByin interfaceJpaCriteriaQuery<T>
-
orderBy
Description copied from interface:JpaCriteriaQuerySet the ordering expressions.- Specified by:
orderByin interfaceCriteriaQuery<T>- Specified by:
orderByin interfaceJpaCriteriaQuery<T>
-
subquery
Description copied from interface:JpaCriteriaBaseCreate a subquery with the given result type.- Specified by:
subqueryin interfaceCommonAbstractCriteria- Specified by:
subqueryin interfaceJpaCriteriaBase
-
where
Description copied from interface:JpaSelectCriteriaSet the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>- Overrides:
wherein classAbstractSqmSelectQuery<T>
-
where
Description copied from interface:JpaSelectCriteriaSet the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>- Overrides:
wherein classAbstractSqmSelectQuery<T>
-
where
@Nonnull public SqmSelectStatement<T> where(@Nonnull List<? extends Expression<Boolean>> restrictions) Description copied from interface:JpaSelectCriteriaSet the restriction.- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceCriteriaQuery<T>- Specified by:
wherein interfaceJpaCriteriaQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>- Overrides:
wherein classAbstractSqmSelectQuery<T>
-
groupBy
Description copied from interface:JpaSelectCriteriaSet the grouping expressions.- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceCriteriaQuery<T>- Specified by:
groupByin interfaceJpaCriteriaQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>- Overrides:
groupByin classAbstractSqmSelectQuery<T>
-
groupBy
Description copied from interface:JpaSelectCriteriaSet the grouping expressions.- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceCriteriaQuery<T>- Specified by:
groupByin interfaceJpaCriteriaQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>- Overrides:
groupByin classAbstractSqmSelectQuery<T>
-
having
Description copied from interface:JpaSelectCriteriaSet the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>- Overrides:
havingin classAbstractSqmSelectQuery<T>
-
having
Description copied from interface:JpaSelectCriteriaSet the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>- Overrides:
havingin classAbstractSqmSelectQuery<T>
-
having
@Nonnull public SqmSelectStatement<T> having(@Nonnull List<? extends Expression<Boolean>> restrictions) Description copied from interface:JpaSelectCriteriaSet the group restriction.- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceCriteriaQuery<T>- Specified by:
havingin interfaceJpaCriteriaQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>- Overrides:
havingin classAbstractSqmSelectQuery<T>
-
getOffset
Description copied from interface:JpaCriteriaQueryReturn the query offset expression.- Specified by:
getOffsetin interfaceJpaCriteriaQuery<T>
-
offset
Description copied from interface:JpaCriteriaQuerySet the query offset.- Specified by:
offsetin interfaceJpaCriteriaQuery<T>
-
offset
Description copied from interface:JpaCriteriaQuerySet the query offset.- Specified by:
offsetin interfaceJpaCriteriaQuery<T>
-
getFetch
Description copied from interface:JpaCriteriaQueryReturn the query fetch expression.- Specified by:
getFetchin interfaceJpaCriteriaQuery<T>
-
fetch
Description copied from interface:JpaCriteriaQuerySet the query fetch limit.- Specified by:
fetchin interfaceJpaCriteriaQuery<T>
-
fetch
@Nonnull public JpaCriteriaQuery<T> fetch(@Nullable JpaExpression<? extends Number> fetch, @Nonnull FetchClauseType fetchClauseType) Description copied from interface:JpaCriteriaQuerySet the query fetch limit.- Specified by:
fetchin interfaceJpaCriteriaQuery<T>
-
fetch
Description copied from interface:JpaCriteriaQuerySet the query fetch limit.- Specified by:
fetchin interfaceJpaCriteriaQuery<T>
-
fetch
@Nonnull public JpaCriteriaQuery<T> fetch(@Nullable Number fetch, @Nonnull FetchClauseType fetchClauseType) Description copied from interface:JpaCriteriaQuerySet the query fetch limit.- Specified by:
fetchin interfaceJpaCriteriaQuery<T>
-
getFetchClauseType
Description copied from interface:JpaCriteriaQueryReturn the fetch clause type.- Specified by:
getFetchClauseTypein interfaceJpaCriteriaQuery<T>
-
createCountQuery
Description copied from interface:JpaCriteriaQueryA query that returns the number of results of this query.- Specified by:
createCountQueryin interfaceJpaCriteriaQuery<T>- See Also:
-
createExistsQuery
Description copied from interface:JpaCriteriaQueryA query that returnstrueif this query has any results.- Specified by:
createExistsQueryin interfaceJpaCriteriaQuery<T>
-
generateAlias
- Specified by:
generateAliasin interfaceSqmQuery<T>
-