public class SubQueryImpl<T> extends AbstractQueryImpl<T> implements InternalExpression, InternalSelection
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.
CriteriaQuery,
SubQuery,
Serialized FormAbstractQueryImpl.ResultType| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
alias |
protected java.util.Set<<any>> |
correlatedJoins |
protected java.util.Set<org.eclipse.persistence.expressions.Expression> |
correlations |
protected SubSelectExpression |
currentNode |
protected CommonAbstractCriteria |
parent |
protected java.util.Set<FromImpl> |
processedJoins |
protected SelectionImpl<?> |
selection |
protected ReportQuery |
subQuery |
baseExpression, distinct, groupBy, havingClause, queryResult, rootsmetamodel, parameters, queryBuilder, queryType, where| Constructor and Description |
|---|
SubQueryImpl(Metamodel metamodel,
java.lang.Class result,
CriteriaBuilderImpl queryBuilder,
CommonAbstractCriteria parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addJoin(FromImpl join) |
void |
addParameter(<any> parameter) |
<any> |
alias(java.lang.String name)
Assign an alias to the selection.
|
<X> <any> |
as(java.lang.Class<X> type) |
<X,K,V> <any> |
correlate(<any> parentMap)
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.
|
<X,Y> <any> |
correlate(<any> parentJoin)
Correlates a join object of the enclosing query to a join object of the
subquery and returns the subquery join object.
|
<X,Y> <any> |
correlate(<any> parentCollection)
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.
|
<X,Y> <any> |
correlate(<any> parentSet)
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.
|
<X,Y> <any> |
correlate(<any> parentList)
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.
|
<Y> <any> |
correlate(<any> parentRoot)
Correlates a root of the enclosing query to a root of the subquery and
returns the subquery root.
|
<any> |
distinct(boolean distinct)
Specify whether duplicate query results will be eliminated.
|
void |
findRootAndParameters(CommonAbstractCriteriaImpl query) |
java.lang.String |
getAlias() |
protected org.eclipse.persistence.expressions.Expression |
getBaseExpression() |
java.util.List<<any>> |
getCompoundSelectionItems()
Return selection items composing a compound selection
|
CommonAbstractCriteria |
getContainingQuery() |
java.util.Set<<any>> |
getCorrelatedJoins()
Return the joins that have been made from the subquery.
|
org.eclipse.persistence.expressions.Expression |
getCurrentNode()
Returns the current EclipseLink expression at this node in the criteria expression tree
|
DatabaseQuery |
getDatabaseQuery() |
java.lang.Class<T> |
getJavaType() |
java.util.Set<<any>> |
getParameters()
Return the parameters of the query
|
<any> |
getParent()
Return the query of which this is a subquery.
|
<any> |
getSelection()
Return the selection item of the query.
|
<any> |
groupBy(<any>... grouping)
Specify the expressions that are used to form groups over the query
results.
|
<any> |
groupBy(java.util.List<<any>> grouping)
Specify the expressions that are used to form groups over the query
results.
|
<any> |
having(<any> restriction)
Specify a restriction over the groups of the query.
|
<any> |
having(Predicate... restrictions)
Specify restrictions over the groups of the query according the
conjunction of the specified restriction predicates.
|
Predicate |
in(<any>... values)
Apply a predicate to test whether the expression is a member
of the argument list.
|
Predicate |
in(<any> values)
Apply a predicate to test whether the expression is a member
of the collection.
|
Predicate |
in(java.util.Collection<?> values)
Apply a predicate to test whether the expression is a member
of the collection.
|
Predicate |
in(java.lang.Object... values) |
protected void |
integrateRoot(RootImpl root)
Used to use a root from a different query.
|
protected org.eclipse.persistence.expressions.Expression |
internalCorrelate(FromImpl from) |
boolean |
isCompoundExpression() |
boolean |
isCompoundSelection()
Whether the selection item is a compound selection
|
boolean |
isConstructor() |
boolean |
isExpression() |
boolean |
isFrom() |
boolean |
isJunction() |
boolean |
isLiteral() |
Predicate |
isNotNull() |
Predicate |
isNull() |
boolean |
isParameter() |
boolean |
isPredicate() |
boolean |
isRoot() |
boolean |
isSubquery() |
<any> |
select(<any> selection)
Specify the item that is to be returned in the query result.
|
<any> |
where(<any> restriction)
Modify the query to restrict the query result according to the specified
boolean expression.
|
<any> |
where(Predicate... restrictions)
Modify the query to restrict the query result according to the
conjunction of the specified restriction predicates.
|
findJoins, from, from, getBaseExpression, getGroupList, getGroupRestriction, getRoots, isDistinctgetRestriction, getResultType, internalFrom, internalFrom, subquery, translateprotected SelectionImpl<?> selection
protected SubSelectExpression currentNode
protected java.lang.String alias
protected ReportQuery subQuery
protected java.util.Set<<any>> correlatedJoins
protected CommonAbstractCriteria parent
protected java.util.Set<FromImpl> processedJoins
protected java.util.Set<org.eclipse.persistence.expressions.Expression> correlations
public SubQueryImpl(Metamodel metamodel,
java.lang.Class result,
CriteriaBuilderImpl queryBuilder,
CommonAbstractCriteria parent)
public <any> select(<any> selection)
selection - selection specifying the item that
is to be returned in the query resultpublic <any> where(<any> restriction)
where in class AbstractQueryImpl<T>restriction - a simple or compound boolean expressionpublic <any> where(Predicate... restrictions)
where in class AbstractQueryImpl<T>restrictions - zero or more restriction predicatespublic <any> groupBy(<any>... grouping)
groupBy in class AbstractQueryImpl<T>grouping - zero or more grouping expressionspublic <any> groupBy(java.util.List<<any>> grouping)
groupBy in class AbstractQueryImpl<T>grouping - zero or more grouping expressionspublic <any> having(<any> restriction)
having in class AbstractQueryImpl<T>restriction - a simple or compound boolean expressionpublic <any> having(Predicate... restrictions)
having in class AbstractQueryImpl<T>restrictions - zero or more restriction predicatespublic <Y> <any> correlate(<any> parentRoot)
parentRoot - a root of the containing querypublic <X,Y> <any> correlate(<any> parentJoin)
parentJoin - join target of the containing querypublic <X,Y> <any> correlate(<any> parentCollection)
parentCollection - join target of the containing querypublic <X,Y> <any> correlate(<any> parentSet)
parentSet - join target of the containing querypublic <X,Y> <any> correlate(<any> parentList)
parentList - join target of the containing querypublic <X,K,V> <any> correlate(<any> parentMap)
parentMap - join target of the containing queryprotected org.eclipse.persistence.expressions.Expression internalCorrelate(FromImpl from)
public java.util.Set<<any>> getParameters()
CommonAbstractCriteriaImplgetParameters in class CommonAbstractCriteriaImpl<T>public <any> getParent()
public <any> distinct(boolean distinct)
distinct in class AbstractQueryImpl<T>distinct - boolean value specifying whether duplicate results must be
eliminated from the query result or whether they must be
retainedpublic org.eclipse.persistence.expressions.Expression getCurrentNode()
getCurrentNode in interface InternalSelectionpublic <any> getSelection()
public java.util.Set<<any>> getCorrelatedJoins()
public void addParameter(<any> parameter)
addParameter in class CommonAbstractCriteriaImpl<T>public void addJoin(FromImpl join)
addJoin in class AbstractQueryImpl<T>public <X> <any> as(java.lang.Class<X> type)
public Predicate in(java.lang.Object... values)
public Predicate in(<any>... values)
values - public Predicate in(java.util.Collection<?> values)
values - collectionpublic Predicate in(<any> values)
values - expression corresponding to collectionpublic Predicate isNotNull()
public Predicate isNull()
public <any> alias(java.lang.String name)
name - aliaspublic java.lang.String getAlias()
public java.lang.Class<T> getJavaType()
public java.util.List<<any>> getCompoundSelectionItems()
java.lang.IllegalStateException - if selection is not a compound
selectionpublic boolean isCompoundSelection()
public boolean isConstructor()
isConstructor in interface InternalSelectionpublic boolean isJunction()
isJunction in interface InternalExpressionpublic boolean isPredicate()
isPredicate in interface InternalExpressionpublic boolean isParameter()
isParameter in interface InternalExpressionpublic boolean isRoot()
isRoot in interface InternalSelectionpublic boolean isSubquery()
isSubquery in interface InternalExpressionprotected void integrateRoot(RootImpl root)
CommonAbstractCriteriaImplintegrateRoot in class AbstractQueryImpl<T>public boolean isCompoundExpression()
isCompoundExpression in interface InternalExpressionpublic boolean isExpression()
isExpression in interface InternalExpressionpublic boolean isFrom()
isFrom in interface InternalSelectionpublic boolean isLiteral()
isLiteral in interface InternalExpressionpublic void findRootAndParameters(CommonAbstractCriteriaImpl query)
findRootAndParameters in interface InternalSelectionfindRootAndParameters in class AbstractQueryImpl<T>protected org.eclipse.persistence.expressions.Expression getBaseExpression()
getBaseExpression in class AbstractQueryImpl<T>public CommonAbstractCriteria getContainingQuery()
public DatabaseQuery getDatabaseQuery()
getDatabaseQuery in class CommonAbstractCriteriaImpl<T>