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

public Class SqmSelectStatement<T>

extends AbstractSqmSelectQuery<T>
implements JpaCriteriaQuery<T>, SqmStatement<T>, ParameterCollector
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.internal.ParameterCollector, org.hibernate.query.sqm.tree.SqmStatement, org.hibernate.query.sqm.tree.SqmVisitableNode, org.hibernate.query.sqm.tree.SqmNode, org.hibernate.query.criteria.JpaCriteriaNode, java.io.Serializable, org.hibernate.query.criteria.JpaQueryableCriteria, org.hibernate.query.criteria.JpaCteContainer, org.hibernate.query.criteria.JpaCriteriaBase, jakarta.persistence.criteria.CommonAbstractCriteria, org.hibernate.query.sqm.tree.SqmQuery, org.hibernate.query.criteria.JpaCriteriaQuery, org.hibernate.query.criteria.JpaSelectCriteria, jakarta.persistence.criteria.AbstractQuery, jakarta.persistence.criteria.CriteriaQuery
Imports
java.util.ArrayList, .Collections, .LinkedHashSet, .List, .Map, .Set, java.util.stream.Collectors, jakarta.persistence.Tuple, jakarta.persistence.criteria.Expression, .Order, .ParameterExpression, .Predicate, .Selection, org.hibernate.query.sqm.FetchClauseType, .NodeBuilder, .SemanticQueryWalker, .SqmQuerySource, org.hibernate.query.criteria.JpaCriteriaQuery, .JpaExpression, .JpaSelection, org.hibernate.query.sqm.internal.NoParamSqmCopyContext, .SqmUtil, org.hibernate.query.sqm.tree.SqmCopyContext, .SqmStatement, org.hibernate.query.sqm.tree.cte.SqmCteStatement, org.hibernate.query.sqm.tree.expression.SqmStar, .ValueBindJpaCriteriaParameter, .SqmParameter, org.hibernate.query.sqm.tree.from.SqmFromClause

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private Set<SqmParameter<?>>
private final SqmQuerySource

Constructor Summary

AccessConstructor and Description
public
public
SqmSelectStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder)

public
SqmSelectStatement(Class<T> resultJavaType, SqmQuerySource querySource, NodeBuilder nodeBuilder)

public
SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, SqmQuerySource querySource, NodeBuilder builder)

public
SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, Map<String, SqmCteStatement<?>> cteStatements, SqmQuerySource querySource, NodeBuilder builder)

public
SqmSelectStatement(Class<T> resultJavaType, NodeBuilder nodeBuilder)

public
private
SqmSelectStatement(NodeBuilder builder, Map<String, SqmCteStatement<?>> cteStatements, Class<T> resultType, SqmQuerySource querySource, Set<SqmParameter<?>> parameters)

Method Summary

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

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

Accept the walker per visitation
public void
private void
public boolean
private boolean
public SqmSelectStatement<T>
public JpaCriteriaQuery<Long>
createCountQuery()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.createCountQuery.

Wraps this query in a subquery and returns a count query based on that subquery in the from clause.
public SqmSelectStatement<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.criteria.JpaCriteriaQuery.distinct, org.hibernate.query.sqm.tree.select.SqmSelectQuery.distinct.

Specify whether duplicate query results will be eliminated.
public JpaCriteriaQuery<T>
public JpaCriteriaQuery<T>
public JpaCriteriaQuery<T>
public JpaCriteriaQuery<T>
public JpaExpression<Number>
public FetchClauseType
public JpaExpression<Number>
public Set<ParameterExpression<?>>
getParameters()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.getParameters.

Return the parameters of the query.
public SqmQuerySource
public SqmQuerySpec<T>
public Set<SqmParameter<?>>
getSqmParameters()

Implements org.hibernate.query.sqm.tree.SqmStatement.getSqmParameters.

Access to the (potentially still growing) collection of parameters for the statement.
public SqmSelectStatement<T>
groupBy(Expression<?>...
zero or more grouping expressions
expressions
)

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

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

Specify the expressions that are used to form groups over the query results.
public SqmSelectStatement<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.JpaCriteriaQuery.groupBy, org.hibernate.query.criteria.JpaSelectCriteria.groupBy.

Specify the expressions that are used to form groups over the query results.
public SqmSelectStatement<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.JpaCriteriaQuery.having, org.hibernate.query.criteria.JpaSelectCriteria.having.

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

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

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

Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates.
public SqmSelectStatement<T>
multiselect(Selection<?>...
selection items corresponding to the results to be returned by the query
selections
)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.multiselect.

Specify the selection items that are to be returned in the query result.
public SqmSelectStatement<T>
multiselect(List<Selection<?>>
list of selection items corresponding to the results to be returned by the query
selectionList
)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.multiselect.

Specify the selection items that are to be returned in the query result.
public JpaCriteriaQuery<T>
public JpaCriteriaQuery<T>
public SqmSelectStatement<T>
orderBy(Order...
zero or more ordering expressions
orders
)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.orderBy.

Specify the ordering expressions that are used to order the query results.
public SqmSelectStatement<T>
orderBy(List<Order>
list of zero or more ordering expressions
orders
)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.orderBy.

Specify the ordering expressions that are used to order the query results.
public boolean
private boolean
private void
private void
public SqmStatement.ParameterResolutions
public SqmSelectStatement<T>
select(Selection<? extends T>
selection specifying the item that is to be returned in the query result
selection
)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.select.

Specify the item that is to be returned in the query result.
public <U> SqmSubQuery<U>
public boolean
private boolean
usesDistinct(SqmQueryPart<?> queryPart)

private void
public SqmSelectStatement<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.JpaCriteriaQuery.where, org.hibernate.query.criteria.JpaSelectCriteria.where.

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

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

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

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

Field Detail

parametersback to summary
private Set<SqmParameter<?>> parameters
querySourceback to summary
private final SqmQuerySource querySource

Constructor Detail

SqmSelectStatementback to summary
public SqmSelectStatement(NodeBuilder nodeBuilder)
SqmSelectStatementback to summary
public SqmSelectStatement(SqmQuerySource querySource, NodeBuilder nodeBuilder)
SqmSelectStatementback to summary
public SqmSelectStatement(Class<T> resultJavaType, SqmQuerySource querySource, NodeBuilder nodeBuilder)
SqmSelectStatementback to summary
public SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, SqmQuerySource querySource, NodeBuilder builder)
SqmSelectStatementback to summary
public SqmSelectStatement(SqmQueryPart<T> queryPart, Class<T> resultType, Map<String, SqmCteStatement<?>> cteStatements, SqmQuerySource querySource, NodeBuilder builder)
SqmSelectStatementback to summary
public SqmSelectStatement(Class<T> resultJavaType, NodeBuilder nodeBuilder)

Implementation Note

This form is used from the criteria query API.

SqmSelectStatementback to summary
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.

SqmSelectStatementback to summary
private SqmSelectStatement(NodeBuilder builder, Map<String, SqmCteStatement<?>> cteStatements, Class<T> resultType, SqmQuerySource querySource, Set<SqmParameter<?>> parameters)

Method Detail

acceptback to summary
public <X> X accept(SemanticQueryWalker<X> walker)

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

Doc from org.hibernate.query.sqm.tree.SqmVisitableNode.accept.

Accept the walker per visitation

Annotations
@Override
addParameterback to summary
public void addParameter(SqmParameter<?> parameter)

Implements org.hibernate.query.sqm.internal.ParameterCollector.addParameter.

Annotations
@Override
checkSelectionIsJpaCompliantback to summary
private void checkSelectionIsJpaCompliant(Selection<?> selection)
containsCollectionFetchesback to summary
public boolean containsCollectionFetches()
containsCollectionFetchesback to summary
private boolean containsCollectionFetches(SqmQueryPart<?> queryPart)
copyback to summary
public SqmSelectStatement<T> copy(SqmCopyContext context)

Implements org.hibernate.query.sqm.tree.SqmStatement.copy, org.hibernate.query.sqm.tree.select.SqmSelectQuery.copy, org.hibernate.query.sqm.tree.SqmNode.copy.

Annotations
@Override
createCountQueryback to summary
public JpaCriteriaQuery<Long> createCountQuery()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.createCountQuery.

Doc from org.hibernate.query.criteria.JpaCriteriaQuery.createCountQuery.

Wraps this query in a subquery and returns a count query based on that subquery in the from clause.

Annotations
@Override
distinctback to summary
public SqmSelectStatement<T> distinct(boolean distinct)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.distinct.

Specify whether duplicate query results will be eliminated. A true value will cause duplicates to be eliminated. A false value will cause duplicates to be retained. If distinct has not been specified, duplicate results must be retained. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
distinct:boolean

boolean value specifying whether duplicate results must be eliminated from the query result or whether they must be retained

Returns:SqmSelectStatement<T>

the modified query.

Annotations
@Override
fetchback to summary
public JpaCriteriaQuery<T> fetch(JpaExpression<? extends Number> fetch)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.fetch.

Annotations
@Override
fetchback to summary
public JpaCriteriaQuery<T> fetch(JpaExpression<? extends Number> fetch, FetchClauseType fetchClauseType)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.fetch.

Annotations
@Override
fetchback to summary
public JpaCriteriaQuery<T> fetch(Number fetch)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.fetch.

Annotations
@Override
fetchback to summary
public JpaCriteriaQuery<T> fetch(Number fetch, FetchClauseType fetchClauseType)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.fetch.

Annotations
@Override
getFetchback to summary
public JpaExpression<Number> getFetch()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.getFetch.

Annotations
@Override
getFetchClauseTypeback to summary
public FetchClauseType getFetchClauseType()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.getFetchClauseType.

Annotations
@Override
getOffsetback to summary
public JpaExpression<Number> getOffset()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.getOffset.

Annotations
@Override
getParametersback to summary
public Set<ParameterExpression<?>> getParameters()

Implements org.hibernate.query.criteria.JpaCriteriaQuery.getParameters.

Doc from org.hibernate.query.criteria.JpaCriteriaQuery.getParameters.

Return the parameters of the query. Returns empty set if there are no parameters. Modifications to the set do not affect the query.

Returns:Set<ParameterExpression<?>>

Doc from jakarta.persistence.criteria.CriteriaQuery.getParameters.

the query parameters

Annotations
@Override
getQuerySourceback to summary
public SqmQuerySource getQuerySource()

Implements org.hibernate.query.sqm.tree.SqmStatement.getQuerySource.

Annotations
@Override
getQuerySpecback to summary
public SqmQuerySpec<T> getQuerySpec()

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

Implements org.hibernate.query.criteria.JpaSelectCriteria.getQuerySpec, org.hibernate.query.sqm.tree.select.SqmSelectQuery.getQuerySpec.

Doc from org.hibernate.query.criteria.JpaSelectCriteria.getQuerySpec.

The query structure. See JpaQueryStructure for details

Annotations
@Override
getSqmParametersback to summary
public Set<SqmParameter<?>> getSqmParameters()

Implements org.hibernate.query.sqm.tree.SqmStatement.getSqmParameters.

Doc from org.hibernate.query.sqm.tree.SqmStatement.getSqmParameters.

Access to the (potentially still growing) collection of parameters for the statement.

Annotations
@Override
groupByback to summary
public SqmSelectStatement<T> groupBy(Expression<?>... expressions)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.groupBy.

Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
expressions:Expression<?>[]

zero or more grouping expressions

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
groupByback to summary
public SqmSelectStatement<T> groupBy(List<Expression<?>> grouping)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.groupBy.

Specify the expressions that are used to form groups over the query results. Replaces the previous specified grouping expressions, if any. If no grouping expressions are specified, any previously added grouping expressions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
grouping:List<Expression<?>>

list of zero or more grouping expressions

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
havingback to summary
public SqmSelectStatement<T> having(Expression<Boolean> booleanExpression)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.having.

Specify a restriction over the groups of the query. Replaces the previous having restriction(s), if any. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
booleanExpression:Expression<Boolean>

a simple or compound boolean expression

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
havingback to summary
public SqmSelectStatement<T> having(Predicate... predicates)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.having.

Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. Replaces the previously added having restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
predicates:Predicate[]

zero or more restriction predicates

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
multiselectback to summary
public SqmSelectStatement<T> multiselect(Selection<?>... selections)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.multiselect.

Doc from jakarta.persistence.criteria.CriteriaQuery.multiselect.

Specify the selection items that are to be returned in the query result. Replaces the previously specified selection(s), if any. The type of the result of the query execution depends on the specification of the type of the criteria query object created as well as the arguments to the multiselect method.

An argument to the multiselect method must not be a tuple- or array-valued compound selection item.

The semantics of this method are as follows:

  • If the type of the criteria query is CriteriaQuery<Tuple> (i.e., a criteria query object created by either the createTupleQuery method or by passing a Tuple class argument to the createQuery method), a Tuple object corresponding to the arguments of the multiselect method, in the specified order, will be instantiated and returned for each row that results from the query execution.
  • If the type of the criteria query is CriteriaQuery<X> for some user-defined class X (i.e., a criteria query object created by passing a X class argument to the createQuery method), the arguments to the multiselect method will be passed to the X constructor and an instance of type X will be returned for each row.
  • If the type of the criteria query is CriteriaQuery<X[]> for some class X, an instance of type X[] will be returned for each row. The elements of the array will correspond to the arguments of the multiselect method, in the specified order.
  • If the type of the criteria query is CriteriaQuery<Object> or if the criteria query was created without specifying a type, and only a single argument is passed to the multiselect method, an instance of type Object will be returned for each row.
  • If the type of the criteria query is CriteriaQuery<Object> or if the criteria query was created without specifying a type, and more than one argument is passed to the multiselect method, an instance of type Object[] will be instantiated and returned for each row. The elements of the array will correspond to the arguments to the multiselect method, in the specified order.
Parameters
selections:Selection<?>[]

selection items corresponding to the results to be returned by the query

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
multiselectback to summary
public SqmSelectStatement<T> multiselect(List<Selection<?>> selectionList)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.multiselect.

Doc from jakarta.persistence.criteria.CriteriaQuery.multiselect.

Specify the selection items that are to be returned in the query result. Replaces the previously specified selection(s), if any.

The type of the result of the query execution depends on the specification of the type of the criteria query object created as well as the argument to the multiselect method. An element of the list passed to the multiselect method must not be a tuple- or array-valued compound selection item.

The semantics of this method are as follows:

  • If the type of the criteria query is CriteriaQuery<Tuple> (i.e., a criteria query object created by either the createTupleQuery method or by passing a Tuple class argument to the createQuery method), a Tuple object corresponding to the elements of the list passed to the multiselect method, in the specified order, will be instantiated and returned for each row that results from the query execution.
  • If the type of the criteria query is CriteriaQuery<X> for some user-defined class X (i.e., a criteria query object created by passing a X class argument to the createQuery method), the elements of the list passed to the multiselect method will be passed to the X constructor and an instance of type X will be returned for each row.
  • If the type of the criteria query is CriteriaQuery<X[]> for some class X, an instance of type X[] will be returned for each row. The elements of the array will correspond to the elements of the list passed to the multiselect method, in the specified order.
  • If the type of the criteria query is CriteriaQuery<Object> or if the criteria query was created without specifying a type, and the list passed to the multiselect method contains only a single element, an instance of type Object will be returned for each row.
  • If the type of the criteria query is CriteriaQuery<Object> or if the criteria query was created without specifying a type, and the list passed to the multiselect method contains more than one element, an instance of type Object[] will be instantiated and returned for each row. The elements of the array will correspond to the elements of the list passed to the multiselect method, in the specified order.
Parameters
selectionList:List<Selection<?>>

list of selection items corresponding to the results to be returned by the query

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
@SuppressWarnings:unchecked
offsetback to summary
public JpaCriteriaQuery<T> offset(JpaExpression<? extends Number> offset)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.offset.

Annotations
@Override
offsetback to summary
public JpaCriteriaQuery<T> offset(Number offset)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.offset.

Annotations
@Override
orderByback to summary
public SqmSelectStatement<T> orderBy(Order... orders)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.orderBy.

Doc from jakarta.persistence.criteria.CriteriaQuery.orderBy.

Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous ordering, if any, is simply removed, and results will be returned in no particular order. The left-to-right sequence of the ordering expressions determines the precedence, whereby the leftmost has highest precedence.

Parameters
orders:Order[]

zero or more ordering expressions

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
orderByback to summary
public SqmSelectStatement<T> orderBy(List<Order> orders)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.orderBy.

Doc from jakarta.persistence.criteria.CriteriaQuery.orderBy.

Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous ordering, if any, is simply removed, and results will be returned in no particular order. The order of the ordering expressions in the list determines the precedence, whereby the first element in the list has highest precedence.

Parameters
orders:List<Order>

list of zero or more ordering expressions

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
producesUniqueResultsback to summary
public boolean producesUniqueResults()
producesUniqueResultsback to summary
private boolean producesUniqueResults(SqmQueryPart<?> queryPart)
resetSelectionsback to summary
private void resetSelections(SqmQueryPart<?> queryPart)
resetSelectionsback to summary
private void resetSelections(SqmQuerySpec<?> querySpec)
resolveParametersback to summary
public SqmStatement.ParameterResolutions resolveParameters()

Implements org.hibernate.query.sqm.tree.SqmStatement.resolveParameters.

Annotations
@Override
selectback to summary
public SqmSelectStatement<T> select(Selection<? extends T> selection)

Implements org.hibernate.query.criteria.JpaCriteriaQuery.select.

Doc from jakarta.persistence.criteria.CriteriaQuery.select.

Specify the item that is to be returned in the query result. Replaces the previously specified selection(s), if any.

Note

Applications using the string-based API may need to specify the type of the select item when it results from a get or join operation and the query result type is specified.

    For example:

    CriteriaQuery<String> q = cb.createQuery(String.class);
    Root<Order> order = q.from(Order.class);
    q.select(order.get("shippingAddress").<String>get("state"));

    CriteriaQuery<Product> q2 = cb.createQuery(Product.class);
    q2.select(q2.from(Order.class)
                .join("items")
                .<Item,Product>join("product"));

Parameters
selection:Selection<? extends T>

selection specifying the item that is to be returned in the query result

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
@SuppressWarnings:unchecked
subqueryback to summary
public <U> SqmSubQuery<U> subquery(Class<U> type)

Implements jakarta.persistence.criteria.CommonAbstractCriteria.subquery, org.hibernate.query.criteria.JpaCriteriaBase.subquery.

Doc from jakarta.persistence.criteria.CommonAbstractCriteria.subquery.

Create a subquery of the query.

Parameters
type:Class<U>

the subquery result type

Returns:SqmSubQuery<U>

subquery

Annotations
@Override
usesDistinctback to summary
public boolean usesDistinct()
usesDistinctback to summary
private boolean usesDistinct(SqmQueryPart<?> queryPart)
validateComplianceFetchOffsetback to summary
private void validateComplianceFetchOffset()
whereback to summary
public SqmSelectStatement<T> where(Expression<Boolean> restriction)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.where.

Modify the query to restrict the query result according to the specified boolean expression. Replaces the previously added restriction(s), if any. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
restriction:Expression<Boolean>

a simple or compound boolean expression

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override
whereback to summary
public SqmSelectStatement<T> where(Predicate... restrictions)

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

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

Doc from jakarta.persistence.criteria.CriteriaQuery.where.

Modify the query to restrict the query result according to the conjunction of the specified restriction predicates. Replaces the previously added restriction(s), if any. If no restrictions are specified, any previously added restrictions are simply removed. This method only overrides the return type of the corresponding AbstractQuery method.

Parameters
restrictions:Predicate[]

zero or more restriction predicates

Returns:SqmSelectStatement<T>

the modified query

Annotations
@Override