Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.querydef

public Class SubQueryImpl<T>

extends AbstractQueryImpl<T>
implements Subquery<T>, InternalExpression, InternalSelection
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.internal.jpa.querydef.InternalSelection, org.eclipse.persistence.internal.jpa.querydef.InternalExpression, jakarta.persistence.criteria.Subquery, jakarta.persistence.criteria.Expression, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement, jakarta.persistence.criteria.AbstractQuery, jakarta.persistence.criteria.CommonAbstractCriteria
Imports
java.util.ArrayList, .Collection, .HashSet, .Iterator, .List, .Set, jakarta.persistence.criteria.AbstractQuery, .CollectionJoin, .CommonAbstractCriteria, .Expression, .Join, .ListJoin, .MapJoin, .ParameterExpression, .Predicate, .Root, .Selection, .SetJoin, .Subquery, jakarta.persistence.metamodel.Metamodel, .Type.PersistenceType, org.eclipse.persistence.expressions.ExpressionBuilder, org.eclipse.persistence.internal.expressions.ConstantExpression, .SubSelectExpression, org.eclipse.persistence.internal.helper.ClassConstants, org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl, .TypeImpl, org.eclipse.persistence.internal.localization.ExceptionLocalization, org.eclipse.persistence.queries.DatabaseQuery, .ObjectLevelReadQuery, .ReportQuery

Purpose: Contains the implementation of the SubQuery interface of the JPA criteria API.

Description: This is the container class for the components that define a query to be used in a sub select expression.

Author
gyorke
Since
EclipseLink 2.0
See Also
CriteriaQuery, SubQuery

Field Summary

Modifier and TypeField and Description
protected String
protected Set<Join<?, ?>>
protected Set<Expression>
protected SubSelectExpression
protected CommonAbstractCriteria
protected Set<FromImpl<Z, X>>
protected SelectionImpl<?>
protected ReportQuery
Inherited from org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl:
baseExpressiondistinctgroupByhavingClausequeryResultroots

Constructor Summary

AccessConstructor and Description
public
SubQueryImpl(Metamodel metamodel, Class<T> result, CriteriaBuilderImpl queryBuilder, CommonAbstractCriteria parent)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public Selection<T>
alias(String
alias
name
)

Implements jakarta.persistence.criteria.Selection.alias.

Assign an alias to the selection.
public <X> Expression<X>
as(Class<X>
intended type of the expression
type
)

Implements jakarta.persistence.criteria.Expression.as.

Perform a typecast upon the expression, returning a new expression object.
public <Y> Root<Y>

Returns:

subquery root
correlate
(Root<Y>
a root of the containing query
parentRoot
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a root of the enclosing query to a root of the subquery and returns the subquery root.
public <X, Y> Join<X, Y>

Returns:

subquery join
correlate
(Join<X, Y>
join target of the containing query
parentJoin
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a join object of the enclosing query to a join object of the subquery and returns the subquery join object.
public <X, Y> CollectionJoin<X, Y>

Returns:

subquery join
correlate
(CollectionJoin<X, Y>
join target of the containing query
parentCollection
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a join to a Collection-valued association or element collection in the enclosing query to a join object of the subquery and returns the subquery join object.
public <X, Y> SetJoin<X, Y>

Returns:

subquery join
correlate
(SetJoin<X, Y>
join target of the containing query
parentSet
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a join to a Set-valued association or element collection in the enclosing query to a join object of the subquery and returns the subquery join object.
public <X, Y> ListJoin<X, Y>

Returns:

subquery join
correlate
(ListJoin<X, Y>
join target of the containing query
parentList
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a join to a List-valued association or element collection in the enclosing query to a join object of the subquery and returns the subquery join object.
public <X, K, V> MapJoin<X, K, V>

Returns:

subquery join
correlate
(MapJoin<X, K, V>
join target of the containing query
parentMap
)

Implements jakarta.persistence.criteria.Subquery.correlate.

Correlates a join to a Map-valued association or element collection in the enclosing query to a join object of the subquery and returns the subquery join object.
public Subquery<T>

Returns:

the modified query.
distinct
(boolean
boolean value specifying whether duplicate results must be eliminated from the query result or whether they must be retained
distinct
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.distinct.

Implements jakarta.persistence.criteria.Subquery.distinct, jakarta.persistence.criteria.AbstractQuery.distinct.

Specify whether duplicate query results will be eliminated.
public void
public String
getAlias()

Implements jakarta.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.
protected Expression
public List<Selection<?>>

Returns:

list of selection items
getCompoundSelectionItems
()

Implements jakarta.persistence.criteria.Selection.getCompoundSelectionItems.

Return selection items composing a compound selection
public CommonAbstractCriteria
getContainingQuery()

Implements jakarta.persistence.criteria.Subquery.getContainingQuery.

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

Returns:

joins made from this type
getCorrelatedJoins
()

Implements jakarta.persistence.criteria.Subquery.getCorrelatedJoins.

Return the joins that have been made from the subquery.
public Expression

Returns:

the currentNode
getCurrentNode
()

Implements org.eclipse.persistence.internal.jpa.querydef.InternalSelection.getCurrentNode.

Returns the current EclipseLink expression at this node in the criteria expression tree
public DatabaseQuery
public Class<T>
getJavaType()

Implements jakarta.persistence.TupleElement.getJavaType.

Return the Java type of the tuple element.
public Set<ParameterExpression<?>>
public AbstractQuery<?>

Returns:

the enclosing query or subquery
getParent
()

Implements jakarta.persistence.criteria.Subquery.getParent.

Return the query of which this is a subquery.
public Expression<T>

Returns:

the selection item of the query
getSelection
()

Implements jakarta.persistence.criteria.Subquery.getSelection, jakarta.persistence.criteria.AbstractQuery.getSelection.

Return the selection item of the query.
public Subquery<T>

Returns:

the modified query
groupBy
(Expression<?>...
zero or more grouping expressions
grouping
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.groupBy.

Implements jakarta.persistence.criteria.Subquery.groupBy, jakarta.persistence.criteria.AbstractQuery.groupBy.

Specify the expressions that are used to form groups over the query results.
public Subquery<T>

Returns:

the modified query
groupBy
(List<Expression<?>>
zero or more grouping expressions
grouping
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.groupBy.

Implements jakarta.persistence.criteria.Subquery.groupBy, jakarta.persistence.criteria.AbstractQuery.groupBy.

Specify the expressions that are used to form groups over the query results.
public Subquery<T>

Returns:

the modified query
having
(Expression<Boolean>
a simple or compound boolean expression
restriction
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.having.

Implements jakarta.persistence.criteria.Subquery.having, jakarta.persistence.criteria.AbstractQuery.having.

Specify a restriction over the groups of the query.
public Subquery<T>

Returns:

the modified query
having
(Predicate...
zero or more restriction predicates
restrictions
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.having.

Implements jakarta.persistence.criteria.Subquery.having, jakarta.persistence.criteria.AbstractQuery.having.

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

Implements jakarta.persistence.criteria.Expression.in.

Create a predicate to test whether the expression is a member of the argument list.
public Predicate

Returns:

predicate testing for membership
in
(Expression<?>...
expressions to be tested against
values
)

Implements jakarta.persistence.criteria.Expression.in.

Apply a predicate to test whether the expression is a member of the argument list.
public Predicate

Returns:

predicate testing for membership
in
(Collection<?>
collection
values
)

Implements jakarta.persistence.criteria.Expression.in.

Apply a predicate to test whether the expression is a member of the collection.
public Predicate

Returns:

predicate testing for membership
in
(Expression<Collection<?>>
expression corresponding to collection
values
)

Implements jakarta.persistence.criteria.Expression.in.

Apply a predicate to test whether the expression is a member of the collection.
protected void
protected Expression
public boolean
public boolean

Returns:

boolean
isCompoundSelection
()

Implements jakarta.persistence.criteria.Selection.isCompoundSelection.

Whether the selection item is a compound selection
public boolean
public boolean
public boolean
public boolean
public boolean
public Predicate
isNotNull()

Implements jakarta.persistence.criteria.Expression.isNotNull.

Create a predicate to test whether the expression is not null.
public Predicate
isNull()

Implements jakarta.persistence.criteria.Expression.isNull.

Create a predicate to test whether the expression is null.
public boolean
public boolean
public boolean
public boolean
public Subquery<T>

Returns:

the modified query
select
(Expression<T>
selection specifying the item that is to be returned in the query result
selection
)

Implements jakarta.persistence.criteria.Subquery.select.

Specify the item that is to be returned in the query result.
public Subquery<T>

Returns:

the modified query
where
(Expression<Boolean>
a simple or compound boolean expression
restriction
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.where.

Implements jakarta.persistence.criteria.Subquery.where, jakarta.persistence.criteria.AbstractQuery.where.

Modify the query to restrict the query result according to the specified boolean expression.
public Subquery<T>

Returns:

the modified query
where
(Predicate...
zero or more restriction predicates
restrictions
)

Overrides org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl.where.

Implements jakarta.persistence.criteria.Subquery.where, jakarta.persistence.criteria.AbstractQuery.where.

Modify the query to restrict the query result according to the conjunction of the specified restriction predicates.
Inherited from org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl:
findJoinsfromfromgetBaseExpressiongetGroupListgetGroupRestrictiongetRootsisDistinct