Class SqmSelectStatement<T>
- java.lang.Object
-
- org.hibernate.query.sqm.tree.AbstractSqmNode
-
- org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery<T>
-
- org.hibernate.query.sqm.tree.select.SqmSelectStatement<T>
-
- All Implemented Interfaces:
AbstractQuery<T>
,CommonAbstractCriteria
,CriteriaQuery<T>
,Serializable
,JpaCriteriaBase
,JpaCriteriaNode
,JpaCriteriaQuery<T>
,JpaCteContainer
,JpaQueryableCriteria<T>
,JpaSelectCriteria<T>
,ParameterCollector
,SqmCteContainer
,SqmSelectQuery<T>
,SqmNode
,SqmQuery<T>
,SqmStatement<T>
,SqmVisitableNode
public class SqmSelectStatement<T> extends AbstractSqmSelectQuery<T> implements JpaCriteriaQuery<T>, SqmStatement<T>, ParameterCollector
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.query.sqm.tree.SqmStatement
SqmStatement.ParameterResolutions
-
-
Constructor Summary
Constructors Constructor Description SqmSelectStatement(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)
-
Method Summary
-
Methods inherited from class org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery
appendHqlString, copyCteStatements, from, from, from, from, getCteCriteria, getCteCriterias, getCteStatement, getCteStatements, getGroupList, getGroupRestriction, getQueryPart, getRestriction, getResultSelection, getResultType, getRootList, getRoots, getSelection, isDistinct, setQueryPart, setResultType, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinct
-
Methods inherited from class org.hibernate.query.sqm.tree.AbstractSqmNode
nodeBuilder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.persistence.criteria.AbstractQuery
getGroupList, getResultType, getRoots, isDistinct
-
Methods inherited from interface org.hibernate.query.criteria.JpaCriteriaQuery
from, from, getOrderList, getRootList
-
Methods inherited from interface org.hibernate.query.criteria.JpaCteContainer
getCteCriteria, getCteCriterias, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinct
-
Methods inherited from interface org.hibernate.query.criteria.JpaSelectCriteria
from, from, getGroupRestriction, getRestriction, getSelection
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText, nodeBuilder
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
appendHqlString, toHqlString
-
-
-
-
Constructor Detail
-
SqmSelectStatement
public SqmSelectStatement(NodeBuilder nodeBuilder)
-
SqmSelectStatement
public SqmSelectStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder)
-
SqmSelectStatement
public SqmSelectStatement(Class<T> resultJavaType, SqmQuerySource querySource, NodeBuilder nodeBuilder)
-
SqmSelectStatement
public SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, SqmQuerySource querySource, NodeBuilder builder)
-
SqmSelectStatement
public SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, Map<String,SqmCteStatement<?>> cteStatements, SqmQuerySource querySource, NodeBuilder builder)
-
SqmSelectStatement
public SqmSelectStatement(Class<T> resultJavaType, NodeBuilder nodeBuilder)
- Implementation Note:
- This form is used from the criteria query API.
-
SqmSelectStatement
public SqmSelectStatement(SqmSelectStatement<T> original)
- 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.
-
-
Method Detail
-
copy
public SqmSelectStatement<T> copy(SqmCopyContext context)
-
validateResultType
public void validateResultType(Class<?> resultType)
-
getQuerySource
public SqmQuerySource getQuerySource()
- Specified by:
getQuerySource
in interfaceSqmStatement<T>
-
getQuerySpec
public SqmQuerySpec<T> getQuerySpec()
Description copied from interface:JpaSelectCriteria
The query structure. SeeJpaQueryStructure
for details- Specified by:
getQuerySpec
in interfaceJpaSelectCriteria<T>
- Specified by:
getQuerySpec
in interfaceSqmSelectQuery<T>
- Overrides:
getQuerySpec
in classAbstractSqmSelectQuery<T>
-
producesUniqueResults
public boolean producesUniqueResults()
-
containsCollectionFetches
public boolean containsCollectionFetches()
-
usesDistinct
public boolean usesDistinct()
-
getSqmParameters
public Set<SqmParameter<?>> getSqmParameters()
Description copied from interface:SqmStatement
Access to the (potentially still growing) collection of parameters for the statement.- Specified by:
getSqmParameters
in interfaceSqmStatement<T>
-
resolveParameters
public SqmStatement.ParameterResolutions resolveParameters()
- Specified by:
resolveParameters
in interfaceSqmStatement<T>
-
accept
public <X> X accept(SemanticQueryWalker<X> walker)
Description copied from interface:SqmVisitableNode
Accept the walker per visitation- Specified by:
accept
in interfaceSqmVisitableNode
-
addParameter
public void addParameter(SqmParameter<?> parameter)
- Specified by:
addParameter
in interfaceParameterCollector
-
distinct
public SqmSelectStatement<T> distinct(boolean distinct)
- Specified by:
distinct
in interfaceAbstractQuery<T>
- Specified by:
distinct
in interfaceCriteriaQuery<T>
- Specified by:
distinct
in interfaceJpaCriteriaQuery<T>
- Specified by:
distinct
in interfaceJpaSelectCriteria<T>
- Specified by:
distinct
in interfaceSqmSelectQuery<T>
- Overrides:
distinct
in classAbstractSqmSelectQuery<T>
-
getParameters
public Set<ParameterExpression<?>> getParameters()
Description copied from interface:JpaCriteriaQuery
- Specified by:
getParameters
in interfaceCriteriaQuery<T>
- Specified by:
getParameters
in interfaceJpaCriteriaQuery<T>
-
select
public SqmSelectStatement<T> select(Selection<? extends T> selection)
- Specified by:
select
in interfaceCriteriaQuery<T>
- Specified by:
select
in interfaceJpaCriteriaQuery<T>
-
multiselect
public SqmSelectStatement<T> multiselect(Selection<?>... selections)
- Specified by:
multiselect
in interfaceCriteriaQuery<T>
- Specified by:
multiselect
in interfaceJpaCriteriaQuery<T>
-
multiselect
public SqmSelectStatement<T> multiselect(List<Selection<?>> selectionList)
- Specified by:
multiselect
in interfaceCriteriaQuery<T>
- Specified by:
multiselect
in interfaceJpaCriteriaQuery<T>
-
orderBy
public SqmSelectStatement<T> orderBy(Order... orders)
- Specified by:
orderBy
in interfaceCriteriaQuery<T>
- Specified by:
orderBy
in interfaceJpaCriteriaQuery<T>
-
orderBy
public SqmSelectStatement<T> orderBy(List<Order> orders)
- Specified by:
orderBy
in interfaceCriteriaQuery<T>
- Specified by:
orderBy
in interfaceJpaCriteriaQuery<T>
-
subquery
public <U> SqmSubQuery<U> subquery(Class<U> type)
- Specified by:
subquery
in interfaceCommonAbstractCriteria
- Specified by:
subquery
in interfaceJpaCriteriaBase
-
where
public SqmSelectStatement<T> where(Expression<Boolean> restriction)
- Specified by:
where
in interfaceAbstractQuery<T>
- Specified by:
where
in interfaceCriteriaQuery<T>
- Specified by:
where
in interfaceJpaCriteriaQuery<T>
- Specified by:
where
in interfaceJpaSelectCriteria<T>
- Overrides:
where
in classAbstractSqmSelectQuery<T>
-
where
public SqmSelectStatement<T> where(Predicate... restrictions)
- Specified by:
where
in interfaceAbstractQuery<T>
- Specified by:
where
in interfaceCriteriaQuery<T>
- Specified by:
where
in interfaceJpaCriteriaQuery<T>
- Specified by:
where
in interfaceJpaSelectCriteria<T>
- Overrides:
where
in classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSelectStatement<T> groupBy(Expression<?>... expressions)
- Specified by:
groupBy
in interfaceAbstractQuery<T>
- Specified by:
groupBy
in interfaceCriteriaQuery<T>
- Specified by:
groupBy
in interfaceJpaCriteriaQuery<T>
- Specified by:
groupBy
in interfaceJpaSelectCriteria<T>
- Overrides:
groupBy
in classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSelectStatement<T> groupBy(List<Expression<?>> grouping)
- Specified by:
groupBy
in interfaceAbstractQuery<T>
- Specified by:
groupBy
in interfaceCriteriaQuery<T>
- Specified by:
groupBy
in interfaceJpaCriteriaQuery<T>
- Specified by:
groupBy
in interfaceJpaSelectCriteria<T>
- Overrides:
groupBy
in classAbstractSqmSelectQuery<T>
-
having
public SqmSelectStatement<T> having(Expression<Boolean> booleanExpression)
- Specified by:
having
in interfaceAbstractQuery<T>
- Specified by:
having
in interfaceCriteriaQuery<T>
- Specified by:
having
in interfaceJpaCriteriaQuery<T>
- Specified by:
having
in interfaceJpaSelectCriteria<T>
- Overrides:
having
in classAbstractSqmSelectQuery<T>
-
having
public SqmSelectStatement<T> having(Predicate... predicates)
- Specified by:
having
in interfaceAbstractQuery<T>
- Specified by:
having
in interfaceCriteriaQuery<T>
- Specified by:
having
in interfaceJpaCriteriaQuery<T>
- Specified by:
having
in interfaceJpaSelectCriteria<T>
- Overrides:
having
in classAbstractSqmSelectQuery<T>
-
getOffset
public JpaExpression<Number> getOffset()
- Specified by:
getOffset
in interfaceJpaCriteriaQuery<T>
-
offset
public JpaCriteriaQuery<T> offset(JpaExpression<? extends Number> offset)
- Specified by:
offset
in interfaceJpaCriteriaQuery<T>
-
offset
public JpaCriteriaQuery<T> offset(Number offset)
- Specified by:
offset
in interfaceJpaCriteriaQuery<T>
-
getFetch
public JpaExpression<Number> getFetch()
- Specified by:
getFetch
in interfaceJpaCriteriaQuery<T>
-
fetch
public JpaCriteriaQuery<T> fetch(JpaExpression<? extends Number> fetch)
- Specified by:
fetch
in interfaceJpaCriteriaQuery<T>
-
fetch
public JpaCriteriaQuery<T> fetch(JpaExpression<? extends Number> fetch, FetchClauseType fetchClauseType)
- Specified by:
fetch
in interfaceJpaCriteriaQuery<T>
-
fetch
public JpaCriteriaQuery<T> fetch(Number fetch)
- Specified by:
fetch
in interfaceJpaCriteriaQuery<T>
-
fetch
public JpaCriteriaQuery<T> fetch(Number fetch, FetchClauseType fetchClauseType)
- Specified by:
fetch
in interfaceJpaCriteriaQuery<T>
-
getFetchClauseType
public FetchClauseType getFetchClauseType()
- Specified by:
getFetchClauseType
in interfaceJpaCriteriaQuery<T>
-
createCountQuery
public SqmSelectStatement<Long> createCountQuery()
Description copied from interface:JpaCriteriaQuery
A query that returns the number of results of this query.- Specified by:
createCountQuery
in interfaceJpaCriteriaQuery<T>
- See Also:
SelectionQuery.getResultCount()
-
-