Top Fields Constructors Methods
org.hibernate.query.sqm.tree.select

public Class SqmSubQuery<T>

extends AbstractSqmSelectQuery<T>
implements SqmSelectQuery<T>, JpaSubQuery<T>, SqmExpression<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.criteria.JpaExpression, jakarta.persistence.criteria.Expression, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement, org.hibernate.query.criteria.JpaSelection, org.hibernate.query.criteria.JpaTupleElement, org.hibernate.query.criteria.JpaCriteriaNode, java.io.Serializable, org.hibernate.query.sqm.tree.select.SqmSelectableNode, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.query.sqm.tree.SqmVisitableNode, org.hibernate.query.sqm.tree.SqmNode, org.hibernate.query.sqm.tree.SqmExpressibleAccessor, org.hibernate.query.criteria.JpaSubQuery, org.hibernate.query.criteria.JpaCteContainer, org.hibernate.query.criteria.JpaSelectCriteria, org.hibernate.query.criteria.JpaCriteriaBase, jakarta.persistence.criteria.CommonAbstractCriteria, jakarta.persistence.criteria.AbstractQuery, jakarta.persistence.criteria.Subquery, org.hibernate.query.sqm.tree.select.SqmSelectQuery, org.hibernate.query.sqm.tree.cte.SqmCteContainer, org.hibernate.query.sqm.tree.SqmQuery
Imports
java.math.BigDecimal, .BigInteger, java.util.Collection, .HashSet, .List, .Map, .Set, org.hibernate.metamodel.model.domain.EntityDomainType, org.hibernate.query.criteria.JpaCrossJoin, .JpaCteContainer, .JpaCteCriteria, .JpaEntityJoin, .JpaExpression, .JpaOrder, .JpaSelection, .JpaSubQuery, org.hibernate.query.sqm.FetchClauseType, .NodeBuilder, .SemanticQueryWalker, .SqmExpressible, org.hibernate.query.sqm.tree.SqmCopyContext, .SqmQuery, org.hibernate.query.sqm.tree.cte.SqmCteContainer, .SqmCteStatement, org.hibernate.query.sqm.tree.domain.SqmBagJoin, .SqmCorrelatedBagJoin, .SqmCorrelatedCrossJoin, .SqmCorrelatedEntityJoin, .SqmCorrelatedListJoin, .SqmCorrelatedMapJoin, .SqmCorrelatedRoot, .SqmCorrelatedSetJoin, .SqmCorrelatedSingularJoin, .SqmCorrelation, .SqmListJoin, .SqmMapJoin, .SqmSetJoin, .SqmSingularJoin, org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.sqm.tree.from.SqmAttributeJoin, .SqmCrossJoin, .SqmEntityJoin, .SqmFromClause, .SqmJoin, .SqmRoot, org.hibernate.query.sqm.tree.predicate.SqmInPredicate, .SqmPredicate, org.hibernate.type.descriptor.java.JavaType, jakarta.persistence.Tuple, jakarta.persistence.criteria.AbstractQuery, .CollectionJoin, .Expression, .Join, .ListJoin, .MapJoin, .Order, .PluralJoin, .Predicate, .Root, .Selection, .SetJoin

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private String
private SqmExpressible<T>
private final SqmQuery<?>

Constructor Summary

AccessConstructor and Description
public
SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, NodeBuilder builder)

public
SqmSubQuery(SqmQuery<?> parent, SqmQueryPart<T> queryPart, Class<T> resultType, Map<String, SqmCteStatement<?>> cteStatements, NodeBuilder builder)

public
SqmSubQuery(SqmQuery<?> parent, Class<T> resultType, NodeBuilder builder)

public
SqmSubQuery(SqmQuery<?> parent, NodeBuilder builder)

private
SqmSubQuery(NodeBuilder builder, Map<String, SqmCteStatement<?>> cteStatements, Class<T> resultType, SqmQuery<?> parent, SqmExpressible<T> expressibleType, String alias)

Method Summary

Modifier and TypeMethod and Description
public <T1> T1
accept(SemanticQueryWalker<T1> walker)

Implements org.hibernate.query.sqm.tree.SqmVisitableNode.accept.

Accept the walker per visitation
public SqmSubQuery<T>
alias(String
alias
alias
)

Implements jakarta.persistence.criteria.Selection.alias, org.hibernate.query.criteria.JpaSelection.alias.

Assigns an alias to the selection item.
public void
public void
applyInferableType(SqmExpressible<?> type)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Used to apply type information based on the expression's usage within the query.
private void
public <X> SqmExpression<X>
as(Class<X>
intended type of the expression
type
)

Implements jakarta.persistence.criteria.Expression.as, org.hibernate.query.criteria.JpaExpression.as, org.hibernate.query.sqm.tree.expression.SqmExpression.as.

Perform a typecast upon the expression, returning a new expression object.
public SqmExpression<BigDecimal>
public SqmExpression<BigInteger>
public SqmExpression<Double>
public SqmExpression<Float>
public SqmExpression<Integer>
public String
public SqmExpression<Long>
public SqmExpression<String>
public SqmSubQuery<T>
public <Y> SqmRoot<Y>
correlate(Root<Y>
a root of the containing query
parentRoot
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery root correlated to a root of the enclosing query.
public <X, Y> SqmAttributeJoin<X, Y>
correlate(Join<X, Y>
join object of the containing query
join
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery join object correlated to a join object of the enclosing query.
public <X, Y> SqmBagJoin<X, Y>
correlate(CollectionJoin<X, Y>
join object of the containing query
parentCollection
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery collection join object correlated to a collection join object of the enclosing query.
public <X, Y> SqmSetJoin<X, Y>
correlate(SetJoin<X, Y>
join object of the containing query
parentSet
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery set join object correlated to a set join object of the enclosing query.
public <X, Y> SqmListJoin<X, Y>
correlate(ListJoin<X, Y>
join object of the containing query
parentList
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery list join object correlated to a list join object of the enclosing query.
public <X, K, V> SqmMapJoin<X, K, V>
correlate(MapJoin<X, K, V>
join object of the containing query
parentMap
)

Implements org.hibernate.query.criteria.JpaSubQuery.correlate.

Create a subquery map join object correlated to a map join object of the enclosing query.
public <X> SqmCrossJoin<X>
public <X> SqmEntityJoin<X>
public SqmSubQuery<T>
distinct(boolean
boolean value specifying whether duplicate results must be eliminated from the query result or whether they must be retained
distinct
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.distinct.

Implements org.hibernate.query.sqm.tree.select.SqmSelectQuery.distinct, org.hibernate.query.criteria.JpaSubQuery.distinct.

Specify whether duplicate query results will be eliminated.
public SqmPredicate
public SqmPredicate
public JpaSubQuery<T>
public JpaSubQuery<T>
public JpaSubQuery<T>
public JpaSubQuery<T>
public String
getAlias()

Implements jakarta.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.
public List<Selection<?>>
public SqmQuery<?>
getContainingQuery()

Implements jakarta.persistence.criteria.Subquery.getContainingQuery.

Return the query of which this is a subquery.
public Set<Join<?, ?>>
getCorrelatedJoins()

Implements jakarta.persistence.criteria.Subquery.getCorrelatedJoins.

Return the correlated joins of the subquery.
public <X> JpaCteCriteria<X>
getCteCriteria(String cteName)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.getCteCriteria.

Implements org.hibernate.query.criteria.JpaCteContainer.getCteCriteria.

Returns a CTE that is registered by the given name on this container, or any of its parents.
public SqmCteStatement<?>
public JpaExpression<Number>
public FetchClauseType
public Class<? extends T>
getJavaType()

Overrides default org.hibernate.query.criteria.JpaTupleElement.getJavaType.

Implements jakarta.persistence.TupleElement.getJavaType.

Return the Java type of the tuple element.
public JavaType<T>
public SqmExpressible<T>
public JpaExpression<Number>
public List<JpaOrder>
public SqmSelectQuery<?>
getParent()

Implements jakarta.persistence.criteria.Subquery.getParent.

Return the query of which this is a subquery.
public SqmExpression<T>
public List<? extends JpaSelection<?>>
public Integer
private int
public SqmSubQuery<T>
groupBy(Expression<?>...
zero or more grouping expressions
expressions
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.groupBy.

Implements org.hibernate.query.criteria.JpaSelectCriteria.groupBy, org.hibernate.query.criteria.JpaSubQuery.groupBy.

Specify the expressions that are used to form groups over the query results.
public SqmSubQuery<T>
groupBy(List<Expression<?>>
list of zero or more grouping expressions
grouping
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.groupBy.

Implements org.hibernate.query.criteria.JpaSelectCriteria.groupBy, org.hibernate.query.criteria.JpaSubQuery.groupBy.

Specify the expressions that are used to form groups over the query results.
public SqmSubQuery<T>
having(Expression<Boolean>
a simple or compound boolean expression
booleanExpression
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.having.

Implements org.hibernate.query.criteria.JpaSelectCriteria.having, org.hibernate.query.criteria.JpaSubQuery.having.

Specify a restriction over the groups of the query.
public SqmSubQuery<T>
having(Predicate...
zero or more restriction predicates
predicates
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.having.

Implements org.hibernate.query.criteria.JpaSelectCriteria.having, org.hibernate.query.criteria.JpaSubQuery.having.

Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates.
public SqmInPredicate<?>
in(Object...
values to be tested against
values
)

Implements jakarta.persistence.criteria.Expression.in, org.hibernate.query.criteria.JpaExpression.in, org.hibernate.query.sqm.tree.expression.SqmExpression.in.

Create a predicate to test whether the expression is a member of the argument list.
public SqmInPredicate<?>
in(Expression<?>...
expressions to be tested against
values
)

Implements jakarta.persistence.criteria.Expression.in, org.hibernate.query.criteria.JpaExpression.in, org.hibernate.query.sqm.tree.expression.SqmExpression.in.

Create a predicate to test whether the expression is a member of the argument list.
public SqmInPredicate<?>
in(Collection<?>
collection of values to be tested against
values
)

Implements jakarta.persistence.criteria.Expression.in, org.hibernate.query.criteria.JpaExpression.in, org.hibernate.query.sqm.tree.expression.SqmExpression.in.

Create a predicate to test whether the expression is a member of the collection.
public SqmInPredicate<?>
in(Expression<Collection<?>>
expression corresponding to collection to be tested against
values
)

Implements jakarta.persistence.criteria.Expression.in, org.hibernate.query.criteria.JpaExpression.in, org.hibernate.query.sqm.tree.expression.SqmExpression.in.

Create a predicate to test whether the expression is a member of the collection.
public boolean
isCompoundSelection()

Implements jakarta.persistence.criteria.Selection.isCompoundSelection.

Whether the selection item is a compound selection.
public SqmPredicate
public SqmPredicate
public SqmSubQuery<T>
public SqmSubQuery<T>
public JpaSubQuery<T>
public JpaSubQuery<T>
public JpaSubQuery<T>
public JpaSubQuery<T>
public SqmSubQuery<T>
select(Expression<T>
expression specifying the item that is to be returned as the subquery result
expression
)

Implements org.hibernate.query.criteria.JpaSubQuery.select.

Specify the item that is to be returned as the subquery result.
public <U> SqmSubQuery<U>
private void
private void
private void
public SqmSubQuery<T>
where(Expression<Boolean>
a simple or compound boolean expression
restriction
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.where.

Implements org.hibernate.query.criteria.JpaSelectCriteria.where, org.hibernate.query.criteria.JpaSubQuery.where.

Modify the query to restrict the query results according to the specified boolean expression.
public SqmSubQuery<T>
where(Predicate...
zero or more restriction predicates
restrictions
)

Overrides org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery.where.

Implements org.hibernate.query.criteria.JpaSelectCriteria.where, org.hibernate.query.criteria.JpaSubQuery.where.

Modify the query to restrict the query results according to the conjunction of the specified restriction predicates.
Inherited from org.hibernate.query.sqm.tree.select.AbstractSqmSelectQuery:
copyCteStatementsfromfromfromfromgetCteCriteriasgetCteStatementMapgetCteStatementsgetGroupListgetGroupRestrictiongetQueryPartgetQuerySpecgetRestrictiongetResultSelectiongetResultTypegetRootListgetRootsisDistinctsetQueryPartsetResultTypewithwithwithRecursiveUnionAllwithRecursiveUnionAllwithRecursiveUnionDistinctwithRecursiveUnionDistinct