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.criteria.JpaTupleElement
getJavaTypeName, isEnum
-
Methods inherited from interface org.hibernate.query.sqm.tree.cte.SqmCteContainer
getCteStatements
-
Methods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
cast, 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:
copyin interfaceSqmExpression<T>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmQuery<T>- Specified by:
copyin interfaceSqmSelectableNode<T>- Specified by:
copyin interfaceSqmSelectQuery<T>- Specified by:
copyin interfaceSqmTypedNode<T>
-
getTupleLength
public Integer getTupleLength()
- Specified by:
getTupleLengthin interfaceSqmSelectableNode<T>
-
getCteStatement
public SqmCteStatement<?> getCteStatement(String cteLabel)
- Specified by:
getCteStatementin interfaceSqmCteContainer- Overrides:
getCteStatementin classAbstractSqmSelectQuery<T>
-
getCteCriteria
public <X> JpaCteCriteria<X> getCteCriteria(String cteName)
Description copied from interface:JpaCteContainerReturns a CTE that is registered by the given name on this container, or any of its parents.- Specified by:
getCteCriteriain interfaceJpaCteContainer- Overrides:
getCteCriteriain classAbstractSqmSelectQuery<T>
-
getContainingQuery
public SqmQuery<?> getContainingQuery()
- Specified by:
getContainingQueryin interfaceSubquery<T>
-
getParent
public SqmSelectQuery<?> getParent()
-
getAlias
public String getAlias()
- Specified by:
getAliasin 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:
multiselectin interfaceJpaSubQuery<T>
-
multiselect
public SqmSubQuery<T> multiselect(List<Selection<?>> selectionList)
- Specified by:
multiselectin interfaceJpaSubQuery<T>
-
getSelection
public SqmExpression<T> getSelection()
- Specified by:
getSelectionin interfaceAbstractQuery<T>- Specified by:
getSelectionin interfaceJpaSelectCriteria<T>- Specified by:
getSelectionin interfaceJpaSubQuery<T>- Specified by:
getSelectionin interfaceSubquery<T>- Overrides:
getSelectionin classAbstractSqmSelectQuery<T>
-
isCompoundSelection
public boolean isCompoundSelection()
- Specified by:
isCompoundSelectionin interfaceSelection<T>
-
getSelectionItems
public List<? extends JpaSelection<?>> getSelectionItems()
- Specified by:
getSelectionItemsin interfaceJpaSelection<T>
-
getCompoundSelectionItems
public List<Selection<?>> getCompoundSelectionItems()
- Specified by:
getCompoundSelectionItemsin interfaceJpaSelection<T>- Specified by:
getCompoundSelectionItemsin interfaceSelection<T>
-
distinct
public SqmSubQuery<T> distinct(boolean distinct)
- Specified by:
distinctin interfaceAbstractQuery<T>- Specified by:
distinctin interfaceJpaSelectCriteria<T>- Specified by:
distinctin interfaceJpaSubQuery<T>- Specified by:
distinctin interfaceSqmSelectQuery<T>- Specified by:
distinctin interfaceSubquery<T>- Overrides:
distinctin classAbstractSqmSelectQuery<T>
-
where
public SqmSubQuery<T> where(Expression<Boolean> restriction)
- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>- Specified by:
wherein interfaceJpaSubQuery<T>- Specified by:
wherein interfaceSubquery<T>- Overrides:
wherein classAbstractSqmSelectQuery<T>
-
where
public SqmSubQuery<T> where(Predicate... restrictions)
- Specified by:
wherein interfaceAbstractQuery<T>- Specified by:
wherein interfaceJpaSelectCriteria<T>- Specified by:
wherein interfaceJpaSubQuery<T>- Specified by:
wherein interfaceSubquery<T>- Overrides:
wherein classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSubQuery<T> groupBy(Expression<?>... expressions)
- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>- Specified by:
groupByin interfaceJpaSubQuery<T>- Specified by:
groupByin interfaceSubquery<T>- Overrides:
groupByin classAbstractSqmSelectQuery<T>
-
groupBy
public SqmSubQuery<T> groupBy(List<Expression<?>> grouping)
- Specified by:
groupByin interfaceAbstractQuery<T>- Specified by:
groupByin interfaceJpaSelectCriteria<T>- Specified by:
groupByin interfaceJpaSubQuery<T>- Specified by:
groupByin interfaceSubquery<T>- Overrides:
groupByin classAbstractSqmSelectQuery<T>
-
having
public SqmSubQuery<T> having(Expression<Boolean> booleanExpression)
- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>- Specified by:
havingin interfaceJpaSubQuery<T>- Specified by:
havingin interfaceSubquery<T>- Overrides:
havingin classAbstractSqmSelectQuery<T>
-
having
public SqmSubQuery<T> having(Predicate... predicates)
- Specified by:
havingin interfaceAbstractQuery<T>- Specified by:
havingin interfaceJpaSelectCriteria<T>- Specified by:
havingin interfaceJpaSubQuery<T>- Specified by:
havingin interfaceSubquery<T>- Overrides:
havingin classAbstractSqmSelectQuery<T>
-
getOffset
public JpaExpression<Number> getOffset()
- Specified by:
getOffsetin interfaceJpaSubQuery<T>
-
offset
public JpaSubQuery<T> offset(JpaExpression<? extends Number> offset)
- Specified by:
offsetin interfaceJpaSubQuery<T>
-
offset
public JpaSubQuery<T> offset(Number offset)
- Specified by:
offsetin interfaceJpaSubQuery<T>
-
getFetch
public JpaExpression<Number> getFetch()
- Specified by:
getFetchin interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(JpaExpression<? extends Number> fetch)
- Specified by:
fetchin interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(JpaExpression<? extends Number> fetch, FetchClauseType fetchClauseType)
- Specified by:
fetchin interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(Number fetch)
- Specified by:
fetchin interfaceJpaSubQuery<T>
-
fetch
public JpaSubQuery<T> fetch(Number fetch, FetchClauseType fetchClauseType)
- Specified by:
fetchin interfaceJpaSubQuery<T>
-
getFetchClauseType
public FetchClauseType getFetchClauseType()
- Specified by:
getFetchClauseTypein interfaceJpaSubQuery<T>
-
getOrderList
public List<JpaOrder> getOrderList()
- Specified by:
getOrderListin interfaceJpaSubQuery<T>
-
orderBy
public JpaSubQuery<T> orderBy(Order... orders)
- Specified by:
orderByin interfaceJpaSubQuery<T>
-
orderBy
public JpaSubQuery<T> orderBy(List<Order> orders)
- Specified by:
orderByin 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:
correlatein interfaceJpaSubQuery<T>
-
correlate
public <X> SqmEntityJoin<X> correlate(JpaEntityJoin<X> parentEntityJoin)
- Specified by:
correlatein interfaceJpaSubQuery<T>
-
getCorrelatedJoins
public Set<Join<?,?>> getCorrelatedJoins()
- Specified by:
getCorrelatedJoinsin interfaceSubquery<T>
-
isNull
public SqmPredicate isNull()
- Specified by:
isNullin interfaceExpression<T>- Specified by:
isNullin interfaceJpaExpression<T>- Specified by:
isNullin interfaceSqmExpression<T>
-
isNotNull
public SqmPredicate isNotNull()
- Specified by:
isNotNullin interfaceExpression<T>- Specified by:
isNotNullin interfaceJpaExpression<T>- Specified by:
isNotNullin interfaceSqmExpression<T>
-
equalTo
public SqmPredicate equalTo(Expression<T> that)
- Specified by:
equalToin interfaceJpaExpression<T>- Specified by:
equalToin interfaceSqmExpression<T>
-
equalTo
public SqmPredicate equalTo(T that)
- Specified by:
equalToin interfaceJpaExpression<T>- Specified by:
equalToin interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Object... values)
- Specified by:
inin interfaceExpression<T>- Specified by:
inin interfaceJpaExpression<T>- Specified by:
inin interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Expression<?>... values)
- Specified by:
inin interfaceExpression<T>- Specified by:
inin interfaceJpaExpression<T>- Specified by:
inin interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Collection<?> values)
- Specified by:
inin interfaceExpression<T>- Specified by:
inin interfaceJpaExpression<T>- Specified by:
inin interfaceSqmExpression<T>
-
in
public SqmInPredicate<?> in(Expression<Collection<?>> values)
- Specified by:
inin interfaceExpression<T>- Specified by:
inin interfaceJpaExpression<T>- Specified by:
inin interfaceSqmExpression<T>
-
getNodeType
public @Nullable SqmExpressible<T> getNodeType()
Description copied from interface:SqmExpressionThe expression's type.Can change as a result of calls to
SqmExpression.applyInferableType(org.hibernate.query.sqm.SqmExpressible<?>)- Specified by:
getNodeTypein interfaceSqmExpression<T>- Specified by:
getNodeTypein interfaceSqmTypedNode<T>
-
applyInferableType
public void applyInferableType(@Nullable SqmExpressible<?> type)
Description copied from interface:SqmExpressionUsed to apply type information based on the expression's usage within the query.- Specified by:
applyInferableTypein interfaceSqmExpression<T>
-
asLong
public SqmExpression<Long> asLong()
- Specified by:
asLongin interfaceJpaExpression<T>- Specified by:
asLongin interfaceSqmExpression<T>
-
asInteger
public SqmExpression<Integer> asInteger()
- Specified by:
asIntegerin interfaceJpaExpression<T>- Specified by:
asIntegerin interfaceSqmExpression<T>
-
asFloat
public SqmExpression<Float> asFloat()
- Specified by:
asFloatin interfaceJpaExpression<T>- Specified by:
asFloatin interfaceSqmExpression<T>
-
asDouble
public SqmExpression<Double> asDouble()
- Specified by:
asDoublein interfaceJpaExpression<T>- Specified by:
asDoublein interfaceSqmExpression<T>
-
asBigDecimal
public SqmExpression<BigDecimal> asBigDecimal()
- Specified by:
asBigDecimalin interfaceJpaExpression<T>- Specified by:
asBigDecimalin interfaceSqmExpression<T>
-
asBigInteger
public SqmExpression<BigInteger> asBigInteger()
- Specified by:
asBigIntegerin interfaceJpaExpression<T>- Specified by:
asBigIntegerin interfaceSqmExpression<T>
-
asString
public SqmExpression<String> asString()
- Specified by:
asStringin interfaceJpaExpression<T>- Specified by:
asStringin interfaceSqmExpression<T>
-
as
public <X> SqmExpression<X> as(Class<X> type)
- Specified by:
asin interfaceExpression<T>- Specified by:
asin interfaceJpaExpression<T>- Specified by:
asin interfaceSqmExpression<T>
-
getJavaTypeDescriptor
public JavaType<T> getJavaTypeDescriptor()
- Specified by:
getJavaTypeDescriptorin interfaceJpaTupleElement<T>
-
getJavaType
public Class<? extends T> getJavaType()
- Specified by:
getJavaTypein interfaceJpaTupleElement<T>- Specified by:
getJavaTypein interfaceTupleElement<T>
-
subquery
public <U> SqmSubQuery<U> subquery(Class<U> type)
- Specified by:
subqueryin interfaceCommonAbstractCriteria- Specified by:
subqueryin interfaceJpaCriteriaBase
-
asLoggableText
public String asLoggableText()
- Specified by:
asLoggableTextin interfaceSqmNode
-
accept
public <T1> T1 accept(SemanticQueryWalker<T1> walker)
Description copied from interface:SqmVisitableNodeAccept the walker per visitation- Specified by:
acceptin interfaceSqmVisitableNode
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlStringin interfaceSqmVisitableNode- Overrides:
appendHqlStringin classAbstractSqmSelectQuery<T>
-
-