public class SubQueryImpl<T> extends AbstractQueryImpl<T> implements javax.persistence.criteria.Subquery<T>, 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 FormConstructor and Description |
---|
SubQueryImpl(javax.persistence.metamodel.Metamodel metamodel,
java.lang.Class result,
CriteriaBuilderImpl queryBuilder,
javax.persistence.criteria.CommonAbstractCriteria parent) |
Modifier and Type | Method and Description |
---|---|
void |
addJoin(FromImpl join) |
void |
addParameter(javax.persistence.criteria.ParameterExpression<?> parameter) |
javax.persistence.criteria.Selection<T> |
alias(java.lang.String name)
Assign an alias to the selection.
|
<X> javax.persistence.criteria.Expression<X> |
as(java.lang.Class<X> type) |
<X,Y> javax.persistence.criteria.CollectionJoin<X,Y> |
correlate(javax.persistence.criteria.CollectionJoin<X,Y> 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> javax.persistence.criteria.Join<X,Y> |
correlate(javax.persistence.criteria.Join<X,Y> parentJoin)
Correlates a join object of the enclosing query to a join object of the
subquery and returns the subquery join object.
|
<X,Y> javax.persistence.criteria.ListJoin<X,Y> |
correlate(javax.persistence.criteria.ListJoin<X,Y> parentCollection)
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.
|
<X,K,V> javax.persistence.criteria.MapJoin<X,K,V> |
correlate(javax.persistence.criteria.MapJoin<X,K,V> parentCollection)
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.
|
<Y> javax.persistence.criteria.Root<Y> |
correlate(javax.persistence.criteria.Root<Y> parentRoot)
Correlates a root of the enclosing query to a root of the subquery and
returns the subquery root.
|
<X,Y> javax.persistence.criteria.SetJoin<X,Y> |
correlate(javax.persistence.criteria.SetJoin<X,Y> parentCollection)
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.
|
javax.persistence.criteria.Subquery<T> |
distinct(boolean distinct)
Specify whether duplicate query results will be eliminated.
|
void |
findRootAndParameters(CommonAbstractCriteriaImpl query) |
java.lang.String |
getAlias() |
java.util.List<javax.persistence.criteria.Selection<?>> |
getCompoundSelectionItems()
Return selection items composing a compound selection
|
javax.persistence.criteria.CommonAbstractCriteria |
getContainingQuery() |
java.util.Set<javax.persistence.criteria.Join<?,?>> |
getCorrelatedJoins()
Return the joins that have been made from the subquery.
|
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<javax.persistence.criteria.ParameterExpression<?>> |
getParameters()
Return the parameters of the query
|
javax.persistence.criteria.AbstractQuery<?> |
getParent()
Return the query of which this is a subquery.
|
javax.persistence.criteria.Expression<T> |
getSelection()
Return the selection item of the query.
|
javax.persistence.criteria.Subquery<T> |
groupBy(javax.persistence.criteria.Expression<?>... grouping)
Specify the expressions that are used to form groups over the query
results.
|
javax.persistence.criteria.Subquery<T> |
groupBy(java.util.List<javax.persistence.criteria.Expression<?>> grouping)
Specify the expressions that are used to form groups over the query
results.
|
javax.persistence.criteria.Subquery<T> |
having(javax.persistence.criteria.Expression<java.lang.Boolean> restriction)
Specify a restriction over the groups of the query.
|
javax.persistence.criteria.Subquery<T> |
having(javax.persistence.criteria.Predicate... restrictions)
Specify restrictions over the groups of the query according the
conjunction of the specified restriction predicates.
|
javax.persistence.criteria.Predicate |
in(java.util.Collection<?> values)
Apply a predicate to test whether the expression is a member
of the collection.
|
javax.persistence.criteria.Predicate |
in(javax.persistence.criteria.Expression<?>... values)
Apply a predicate to test whether the expression is a member
of the argument list.
|
javax.persistence.criteria.Predicate |
in(javax.persistence.criteria.Expression<java.util.Collection<?>> values)
Apply a predicate to test whether the expression is a member
of the collection.
|
javax.persistence.criteria.Predicate |
in(java.lang.Object... values) |
boolean |
isCompoundExpression() |
boolean |
isCompoundSelection()
Whether the selection item is a compound selection
|
boolean |
isConstructor() |
boolean |
isExpression() |
boolean |
isFrom() |
boolean |
isJunction() |
boolean |
isLiteral() |
javax.persistence.criteria.Predicate |
isNotNull() |
javax.persistence.criteria.Predicate |
isNull() |
boolean |
isParameter() |
boolean |
isPredicate() |
boolean |
isRoot() |
boolean |
isSubquery() |
javax.persistence.criteria.Subquery<T> |
select(javax.persistence.criteria.Expression<T> selection)
Specify the item that is to be returned in the query result.
|
javax.persistence.criteria.Subquery<T> |
where(javax.persistence.criteria.Expression<java.lang.Boolean> restriction)
Modify the query to restrict the query result according to the specified
boolean expression.
|
javax.persistence.criteria.Subquery<T> |
where(javax.persistence.criteria.Predicate... restrictions)
Modify the query to restrict the query result according to the
conjunction of the specified restriction predicates.
|
from, from, getGroupList, getGroupRestriction, getRoots, isDistinct
getRestriction, getResultType, internalFrom, internalFrom, subquery, translate
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SubQueryImpl(javax.persistence.metamodel.Metamodel metamodel, java.lang.Class result, CriteriaBuilderImpl queryBuilder, javax.persistence.criteria.CommonAbstractCriteria parent)
public javax.persistence.criteria.Subquery<T> select(javax.persistence.criteria.Expression<T> selection)
select
in interface javax.persistence.criteria.Subquery<T>
selection
- selection specifying the item that
is to be returned in the query resultpublic javax.persistence.criteria.Subquery<T> where(javax.persistence.criteria.Expression<java.lang.Boolean> restriction)
where
in interface javax.persistence.criteria.AbstractQuery<T>
where
in interface javax.persistence.criteria.Subquery<T>
where
in class AbstractQueryImpl<T>
restriction
- a simple or compound boolean expressionpublic javax.persistence.criteria.Subquery<T> where(javax.persistence.criteria.Predicate... restrictions)
where
in interface javax.persistence.criteria.AbstractQuery<T>
where
in interface javax.persistence.criteria.Subquery<T>
where
in class AbstractQueryImpl<T>
restrictions
- zero or more restriction predicatespublic javax.persistence.criteria.Subquery<T> groupBy(javax.persistence.criteria.Expression<?>... grouping)
groupBy
in interface javax.persistence.criteria.AbstractQuery<T>
groupBy
in interface javax.persistence.criteria.Subquery<T>
groupBy
in class AbstractQueryImpl<T>
grouping
- zero or more grouping expressionspublic javax.persistence.criteria.Subquery<T> groupBy(java.util.List<javax.persistence.criteria.Expression<?>> grouping)
groupBy
in interface javax.persistence.criteria.AbstractQuery<T>
groupBy
in interface javax.persistence.criteria.Subquery<T>
groupBy
in class AbstractQueryImpl<T>
grouping
- zero or more grouping expressionspublic javax.persistence.criteria.Subquery<T> having(javax.persistence.criteria.Expression<java.lang.Boolean> restriction)
having
in interface javax.persistence.criteria.AbstractQuery<T>
having
in interface javax.persistence.criteria.Subquery<T>
having
in class AbstractQueryImpl<T>
restriction
- a simple or compound boolean expressionpublic javax.persistence.criteria.Subquery<T> having(javax.persistence.criteria.Predicate... restrictions)
having
in interface javax.persistence.criteria.AbstractQuery<T>
having
in interface javax.persistence.criteria.Subquery<T>
having
in class AbstractQueryImpl<T>
restrictions
- zero or more restriction predicatespublic <Y> javax.persistence.criteria.Root<Y> correlate(javax.persistence.criteria.Root<Y> parentRoot)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentRoot
- a root of the containing querypublic <X,Y> javax.persistence.criteria.Join<X,Y> correlate(javax.persistence.criteria.Join<X,Y> parentJoin)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentJoin
- join target of the containing querypublic <X,Y> javax.persistence.criteria.CollectionJoin<X,Y> correlate(javax.persistence.criteria.CollectionJoin<X,Y> parentCollection)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentCollection
- join target of the containing querypublic <X,Y> javax.persistence.criteria.SetJoin<X,Y> correlate(javax.persistence.criteria.SetJoin<X,Y> parentCollection)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentSet
- join target of the containing querypublic <X,Y> javax.persistence.criteria.ListJoin<X,Y> correlate(javax.persistence.criteria.ListJoin<X,Y> parentCollection)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentList
- join target of the containing querypublic <X,K,V> javax.persistence.criteria.MapJoin<X,K,V> correlate(javax.persistence.criteria.MapJoin<X,K,V> parentCollection)
correlate
in interface javax.persistence.criteria.Subquery<T>
parentMap
- join target of the containing querypublic java.util.Set<javax.persistence.criteria.ParameterExpression<?>> getParameters()
CommonAbstractCriteriaImpl
getParameters
in class CommonAbstractCriteriaImpl<T>
public javax.persistence.criteria.AbstractQuery<?> getParent()
getParent
in interface javax.persistence.criteria.Subquery<T>
public javax.persistence.criteria.Subquery<T> distinct(boolean distinct)
distinct
in interface javax.persistence.criteria.AbstractQuery<T>
distinct
in interface javax.persistence.criteria.Subquery<T>
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 Expression getCurrentNode()
getCurrentNode
in interface InternalSelection
public javax.persistence.criteria.Expression<T> getSelection()
public java.util.Set<javax.persistence.criteria.Join<?,?>> getCorrelatedJoins()
getCorrelatedJoins
in interface javax.persistence.criteria.Subquery<T>
public void addParameter(javax.persistence.criteria.ParameterExpression<?> parameter)
addParameter
in class CommonAbstractCriteriaImpl<T>
public void addJoin(FromImpl join)
addJoin
in class AbstractQueryImpl<T>
public <X> javax.persistence.criteria.Expression<X> as(java.lang.Class<X> type)
as
in interface javax.persistence.criteria.Expression<T>
public javax.persistence.criteria.Predicate in(java.lang.Object... values)
in
in interface javax.persistence.criteria.Expression<T>
public javax.persistence.criteria.Predicate in(javax.persistence.criteria.Expression<?>... values)
in
in interface javax.persistence.criteria.Expression<T>
values
- public javax.persistence.criteria.Predicate in(java.util.Collection<?> values)
in
in interface javax.persistence.criteria.Expression<T>
values
- collectionpublic javax.persistence.criteria.Predicate in(javax.persistence.criteria.Expression<java.util.Collection<?>> values)
in
in interface javax.persistence.criteria.Expression<T>
values
- expression corresponding to collectionpublic javax.persistence.criteria.Predicate isNotNull()
isNotNull
in interface javax.persistence.criteria.Expression<T>
public javax.persistence.criteria.Predicate isNull()
isNull
in interface javax.persistence.criteria.Expression<T>
public javax.persistence.criteria.Selection<T> alias(java.lang.String name)
alias
in interface javax.persistence.criteria.Selection<T>
name
- aliaspublic java.lang.String getAlias()
getAlias
in interface javax.persistence.TupleElement<T>
public java.lang.Class<T> getJavaType()
getJavaType
in interface javax.persistence.TupleElement<T>
public java.util.List<javax.persistence.criteria.Selection<?>> getCompoundSelectionItems()
getCompoundSelectionItems
in interface javax.persistence.criteria.Selection<T>
java.lang.IllegalStateException
- if selection is not a compound
selectionpublic boolean isCompoundSelection()
isCompoundSelection
in interface javax.persistence.criteria.Selection<T>
public boolean isConstructor()
isConstructor
in interface InternalSelection
public boolean isJunction()
isJunction
in interface InternalExpression
public boolean isPredicate()
isPredicate
in interface InternalExpression
public boolean isParameter()
isParameter
in interface InternalExpression
public boolean isRoot()
isRoot
in interface InternalSelection
public boolean isSubquery()
isSubquery
in interface InternalExpression
public boolean isCompoundExpression()
isCompoundExpression
in interface InternalExpression
public boolean isExpression()
isExpression
in interface InternalExpression
public boolean isFrom()
isFrom
in interface InternalSelection
public boolean isLiteral()
isLiteral
in interface InternalExpression
public void findRootAndParameters(CommonAbstractCriteriaImpl query)
findRootAndParameters
in interface InternalSelection
public javax.persistence.criteria.CommonAbstractCriteria getContainingQuery()
getContainingQuery
in interface javax.persistence.criteria.Subquery<T>
public DatabaseQuery getDatabaseQuery()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference