Class SqmSubQuery<T>
- java.lang.Object
-
- org.hibernate.query.sqm.tree.AbstractSqmNode
-
- org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery<T>
-
- org.hibernate.query.sqm.tree.select.SqmSubQuery<T>
-
- All Implemented Interfaces:
AbstractQuery<T>
,CommonAbstractCriteria
,Expression<T>
,Selection<T>
,Subquery<T>
,TupleElement<T>
,Serializable
,JpaCriteriaBase
,JpaCriteriaNode
,JpaCteContainer
,JpaExpression<T>
,JpaSelectCriteria<T>
,JpaSelection<T>
,JpaSubQuery<T>
,JpaTupleElement<T>
,SqmCteContainer
,SqmExpression<T>
,SqmSelectableNode<T>
,SqmSelectQuery<T>
,SqmExpressibleAccessor<T>
,SqmNode
,SqmQuery<T>
,SqmTypedNode<T>
,SqmVisitableNode
public class SqmSubQuery<T> extends AbstractSqmSelectQuery<T> implements SqmSelectQuery<T>, JpaSubQuery<T>, SqmExpression<T>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SqmSubQuery(SqmQuery<?> parent, Class<T> resultType, NodeBuilder builder)
SqmSubQuery(SqmQuery<?> parent, NodeBuilder builder)
SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, Map<String,SqmCteStatement<?>> cteStatements, NodeBuilder builder)
SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, NodeBuilder builder)
-
Method Summary
-
Methods inherited from class org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery
copyCteStatements, from, from, from, from, getCteCriterias, getCteStatements, getGroupList, getGroupRestriction, getQueryPart, getQuerySpec, getRestriction, getResultSelection, getResultType, getRootList, getRoots, 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.JpaCteContainer
getCteCriterias, with, with, withRecursiveUnionAll, withRecursiveUnionAll, withRecursiveUnionDistinct, withRecursiveUnionDistinct
-
Methods inherited from interface org.hibernate.query.criteria.JpaSelectCriteria
from, from, from, from, getGroupRestriction, getRestriction
-
Methods inherited from interface org.hibernate.query.sqm.tree.cte.SqmCteContainer
getCteStatements
-
Methods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
castAs, visitSubSelectableNodes
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmNode
nodeBuilder
-
Methods inherited from interface org.hibernate.query.sqm.tree.select.SqmSelectQuery
getQueryPart, getQuerySpec
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmTypedNode
getExpressible, getNodeJavaType
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
toHqlString
-
-
-
-
Constructor Detail
-
SqmSubQuery
public SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, NodeBuilder builder)
-
SqmSubQuery
public SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, Map<String,SqmCteStatement<?>> cteStatements, NodeBuilder builder)
-
SqmSubQuery
public SqmSubQuery(SqmQuery<?> parent, Class<T> resultType, NodeBuilder builder)
-
SqmSubQuery
public SqmSubQuery(SqmQuery<?> parent, NodeBuilder builder)
-
-
Method Detail
-
copy
public SqmSubQuery<T> copy(SqmCopyContext context)
- Specified by:
copy
in interfaceSqmExpression<T>
- Specified by:
copy
in interfaceSqmNode
- Specified by:
copy
in interfaceSqmQuery<T>
- Specified by:
copy
in interfaceSqmSelectableNode<T>
- Specified by:
copy
in interfaceSqmSelectQuery<T>
- Specified by:
copy
in interfaceSqmTypedNode<T>
-
getTupleLength
public Integer getTupleLength()
- Specified by:
getTupleLength
in interfaceSqmSelectableNode<T>
-
getCteStatement
public SqmCteStatement<?> getCteStatement(String cteLabel)
- Specified by:
getCteStatement
in interfaceSqmCteContainer
- Overrides:
getCteStatement
in classAbstractSqmSelectQuery<T>
-
getCteCriteria
public <X> JpaCteCriteria<X> getCteCriteria(String cteName)
Description copied from interface:JpaCteContainer
Returns a CTE that is registered by the given name on this container, or any of its parents.- Specified by:
getCteCriteria
in interfaceJpaCteContainer
- Overrides:
getCteCriteria
in classAbstractSqmSelectQuery<T>
-
getContainingQuery
public SqmQuery<?> getContainingQuery()
- Specified by:
getContainingQuery
in interfaceSubquery<T>
-
getParent
public SqmSelectQuery<?> getParent()
-
getAlias
public String getAlias()
- Specified by:
getAlias
in interfaceTupleElement<T>
-
alias
public SqmSubQuery<T> alias(String alias)
-
select
public SqmSubQuery<T> select(Expression<T> expression)
-
multiselect
public SqmSubQuery<T> multiselect(Selection<?>... selections)
- Specified by:
multiselect
in interfaceJpaSubQuery<T>
-
multiselect
public SqmSubQuery<T> multiselect(List<Selection<?>> selectionList)
- Specified by:
multiselect
in interfaceJpaSubQuery<T>
-
getSelection
public SqmExpression<T> getSelection()
- Specified by:
getSelection
in interfaceAbstractQuery<T>
- Specified by:
getSelection
in interfaceJpaSelectCriteria<T>
- Specified by:
getSelection
in interfaceJpaSubQuery<T>
- Specified by:
getSelection
in interfaceSubquery<T>
- Overrides:
getSelection
in classAbstractSqmSelectQuery<T>
-
isCompoundSelection
public boolean isCompoundSelection()
- Specified by:
isCompoundSelection
in interfaceSelection<T>
-
getSelectionItems
public List<? extends JpaSelection<?>> getSelectionItems()
- Specified by:
getSelectionItems
in interfaceJpaSelection<T>
-
getCompoundSelectionItems
public List<Selection<?>> getCompoundSelectionItems()
- Specified by:
getCompoundSelectionItems
in interfaceJpaSelection<T>
- Specified by:
getCompoundSelectionItems
in interfaceSelection<T>
-
distinct
public SqmSubQuery<T> distinct(boolean distinct)
- Specified by:
distinct
in interfaceAbstractQuery<T>
- Specified by:
distinct
in interfaceJpaSelectCriteria<T>
- Specified by:
distinct
in interfaceJpaSubQuery<T>
- Specified by:
distinct
in interfaceSqmSelectQuery<T>
- Specified by:
distinct
in interfaceSubquery<T>
- Overrides:
distinct
in classAbstractSqmSelectQuery<T>
-
where
public SqmSubQuery<T> where(Expression<Boolean> restriction)
- Specified by:
where
in interfaceAbstractQuery<T>
- Specified by:
where
in interfaceJpaSelectCriteria<T>
- Specified by:
where
in interfaceJpaSubQuery<T>
- Specified by:
where
in interfaceSubquery<T>
- Overrides:
where
in classAbstractSqmSelectQuery<T>
-
where
public SqmSubQuery<T> where(Predicate... restrictions)
- Specified by:
where
in interfaceAbstractQuery<T>
- Specified by:
where
in interfaceJpaSelectCriteria<T>
- Specified by:
where
in interfaceJpaSubQuery<T>
- Specified by:
where
in interfaceSubquery<T>
- Overrides:
where
in classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSubQuery<T> groupBy(Expression<?>... expressions)
- Specified by:
groupBy
in interfaceAbstractQuery<T>
- Specified by:
groupBy
in interfaceJpaSelectCriteria<T>
- Specified by:
groupBy
in interfaceJpaSubQuery<T>
- Specified by:
groupBy
in interfaceSubquery<T>
- Overrides:
groupBy
in classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSubQuery<T> groupBy(List<Expression<?>> grouping)
- Specified by:
groupBy
in interfaceAbstractQuery<T>
- Specified by:
groupBy
in interfaceJpaSelectCriteria<T>
- Specified by:
groupBy
in interfaceJpaSubQuery<T>
- Specified by:
groupBy
in interfaceSubquery<T>
- Overrides:
groupBy
in classAbstractSqmSelectQuery<T>
-
having
public SqmSubQuery<T> having(Expression<Boolean> booleanExpression)
- Specified by:
having
in interfaceAbstractQuery<T>
- Specified by:
having
in interfaceJpaSelectCriteria<T>
- Specified by:
having
in interfaceJpaSubQuery<T>
- Specified by:
having
in interfaceSubquery<T>
- Overrides:
having
in classAbstractSqmSelectQuery<T>
-
having
public SqmSubQuery<T> having(Predicate... predicates)
- Specified by:
having
in interfaceAbstractQuery<T>
- Specified by:
having
in interfaceJpaSelectCriteria<T>
- Specified by:
having
in interfaceJpaSubQuery<T>
- Specified by:
having
in interfaceSubquery<T>
- Overrides:
having
in classAbstractSqmSelectQuery<T>
-
getOffset
public JpaExpression<Number> getOffset()
- Specified by:
getOffset
in interfaceJpaSubQuery<T>
-
offset
public JpaSubQuery<T> offset(JpaExpression<? extends Number> offset)
- Specified by:
offset
in interfaceJpaSubQuery<T>
-
offset
public JpaSubQuery<T> offset(Number offset)
- Specified by:
offset
in interfaceJpaSubQuery<T>
-
getFetch
public JpaExpression<Number> getFetch()
- Specified by:
getFetch
in interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(JpaExpression<? extends Number> fetch)
- Specified by:
fetch
in interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(JpaExpression<? extends Number> fetch, FetchClauseType fetchClauseType)
- Specified by:
fetch
in interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(Number fetch)
- Specified by:
fetch
in interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(Number fetch, FetchClauseType fetchClauseType)
- Specified by:
fetch
in interfaceJpaSubQuery<T>
-
getFetchClauseType
public FetchClauseType getFetchClauseType()
- Specified by:
getFetchClauseType
in interfaceJpaSubQuery<T>
-
getOrderList
public List<JpaOrder> getOrderList()
- Specified by:
getOrderList
in interfaceJpaSubQuery<T>
-
orderBy
public JpaSubQuery<T> orderBy(Order... orders)
- Specified by:
orderBy
in interfaceJpaSubQuery<T>
-
orderBy
public JpaSubQuery<T> orderBy(List<Order> orders)
- Specified by:
orderBy
in interfaceJpaSubQuery<T>
-
correlate
public <X,Y> SqmAttributeJoin<X,Y> correlate(Join<X,Y> join)
-
correlate
public <X,Y> SqmBagJoin<X,Y> correlate(CollectionJoin<X,Y> parentCollection)
-
correlate
public <X,Y> SqmSetJoin<X,Y> correlate(SetJoin<X,Y> parentSet)
-
correlate
public <X,Y> SqmListJoin<X,Y> correlate(ListJoin<X,Y> parentList)
-
correlate
public <X,K,V> SqmMapJoin<X,K,V> correlate(MapJoin<X,K,V> parentMap)
-
correlate
public <X> SqmCrossJoin<X> correlate(JpaCrossJoin<X> parentCrossJoin)
- Specified by:
correlate
in interfaceJpaSubQuery<T>
-
correlate
public <X> SqmEntityJoin<X> correlate(JpaEntityJoin<X> parentEntityJoin)
- Specified by:
correlate
in interfaceJpaSubQuery<T>
-
getCorrelatedJoins
public Set<Join<?,?>> getCorrelatedJoins()
- Specified by:
getCorrelatedJoins
in interfaceSubquery<T>
-
isNull
public SqmPredicate isNull()
- Specified by:
isNull
in interfaceExpression<T>
- Specified by:
isNull
in interfaceJpaExpression<T>
- Specified by:
isNull
in interfaceSqmExpression<T>
-
isNotNull
public SqmPredicate isNotNull()
- Specified by:
isNotNull
in interfaceExpression<T>
- Specified by:
isNotNull
in interfaceJpaExpression<T>
- Specified by:
isNotNull
in interfaceSqmExpression<T>
-
equalTo
public SqmPredicate equalTo(Expression<T> that)
- Specified by:
equalTo
in interfaceJpaExpression<T>
- Specified by:
equalTo
in interfaceSqmExpression<T>
-
equalTo
public SqmPredicate equalTo(T that)
- Specified by:
equalTo
in interfaceJpaExpression<T>
- Specified by:
equalTo
in interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Object... values)
- Specified by:
in
in interfaceExpression<T>
- Specified by:
in
in interfaceJpaExpression<T>
- Specified by:
in
in interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Expression<?>... values)
- Specified by:
in
in interfaceExpression<T>
- Specified by:
in
in interfaceJpaExpression<T>
- Specified by:
in
in interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Collection<?> values)
- Specified by:
in
in interfaceExpression<T>
- Specified by:
in
in interfaceJpaExpression<T>
- Specified by:
in
in interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Expression<Collection<?>> values)
- Specified by:
in
in interfaceExpression<T>
- Specified by:
in
in interfaceJpaExpression<T>
- Specified by:
in
in interfaceSqmExpression<T>
-
getNodeType
public SqmExpressible<T> getNodeType()
Description copied from interface:SqmExpression
The expression's type.Can change as a result of calls to
SqmExpression.applyInferableType(org.hibernate.query.sqm.SqmExpressible<?>)
- Specified by:
getNodeType
in interfaceSqmExpression<T>
- Specified by:
getNodeType
in interfaceSqmTypedNode<T>
-
applyInferableType
public void applyInferableType(SqmExpressible<?> type)
Description copied from interface:SqmExpression
Used to apply type information based on the expression's usage within the query.- Specified by:
applyInferableType
in interfaceSqmExpression<T>
-
asLong
public SqmExpression<Long> asLong()
- Specified by:
asLong
in interfaceJpaExpression<T>
- Specified by:
asLong
in interfaceSqmExpression<T>
-
asInteger
public SqmExpression<Integer> asInteger()
- Specified by:
asInteger
in interfaceJpaExpression<T>
- Specified by:
asInteger
in interfaceSqmExpression<T>
-
asFloat
public SqmExpression<Float> asFloat()
- Specified by:
asFloat
in interfaceJpaExpression<T>
- Specified by:
asFloat
in interfaceSqmExpression<T>
-
asDouble
public SqmExpression<Double> asDouble()
- Specified by:
asDouble
in interfaceJpaExpression<T>
- Specified by:
asDouble
in interfaceSqmExpression<T>
-
asBigDecimal
public SqmExpression<BigDecimal> asBigDecimal()
- Specified by:
asBigDecimal
in interfaceJpaExpression<T>
- Specified by:
asBigDecimal
in interfaceSqmExpression<T>
-
asBigInteger
public SqmExpression<BigInteger> asBigInteger()
- Specified by:
asBigInteger
in interfaceJpaExpression<T>
- Specified by:
asBigInteger
in interfaceSqmExpression<T>
-
asString
public SqmExpression<String> asString()
- Specified by:
asString
in interfaceJpaExpression<T>
- Specified by:
asString
in interfaceSqmExpression<T>
-
as
public <X> SqmExpression<X> as(Class<X> type)
- Specified by:
as
in interfaceExpression<T>
- Specified by:
as
in interfaceJpaExpression<T>
- Specified by:
as
in interfaceSqmExpression<T>
-
getJavaTypeDescriptor
public JavaType<T> getJavaTypeDescriptor()
- Specified by:
getJavaTypeDescriptor
in interfaceJpaTupleElement<T>
-
getJavaType
public Class<? extends T> getJavaType()
- Specified by:
getJavaType
in interfaceJpaTupleElement<T>
- Specified by:
getJavaType
in interfaceTupleElement<T>
-
subquery
public <U> SqmSubQuery<U> subquery(Class<U> type)
- Specified by:
subquery
in interfaceCommonAbstractCriteria
- Specified by:
subquery
in interfaceJpaCriteriaBase
-
asLoggableText
public String asLoggableText()
- Specified by:
asLoggableText
in interfaceSqmNode
-
accept
public <T1> T1 accept(SemanticQueryWalker<T1> walker)
Description copied from interface:SqmVisitableNode
Accept the walker per visitation- Specified by:
accept
in interfaceSqmVisitableNode
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
- Overrides:
appendHqlString
in classAbstractSqmSelectQuery<T>
-
-