public class CriteriaSubqueryImpl<T> extends ExpressionImpl<T> implements Subquery<T>, Serializable
Subquery
contract. Mostlty a set of delegation to its internal
QueryStructure
.Modifier and Type | Class and Description |
---|---|
static class |
CriteriaSubqueryImpl.SubquerySelection<S> |
ParameterContainer.Helper
Constructor and Description |
---|
CriteriaSubqueryImpl(CriteriaBuilderImpl criteriaBuilder,
Class<T> javaType,
CommonAbstractCriteria parent) |
Modifier and Type | Method and Description |
---|---|
<X,Y> CollectionJoin<X,Y> |
correlate(CollectionJoin<X,Y> source)
Create a subquery collection join object correlated to a
collection join object of the enclosing query.
|
<X,Y> Join<X,Y> |
correlate(Join<X,Y> source)
Create a subquery join object correlated to a join object
of the enclosing query.
|
<X,Y> ListJoin<X,Y> |
correlate(ListJoin<X,Y> source)
Create a subquery list join object correlated to a list join
object of the enclosing query.
|
<X,K,V> MapJoin<X,K,V> |
correlate(MapJoin<X,K,V> source)
Create a subquery map join object correlated to a map join
object of the enclosing query.
|
<Y> Root<Y> |
correlate(Root<Y> source)
Create a subquery root correlated to a root of the
enclosing query.
|
<X,Y> SetJoin<X,Y> |
correlate(SetJoin<X,Y> source)
Create a subquery set join object correlated to a set join
object of the enclosing query.
|
Subquery<T> |
distinct(boolean applyDistinction)
Specify whether duplicate query results will be eliminated.
|
<X> Root<X> |
from(Class<X> entityClass)
Create and add a query root corresponding to the given entity,
forming a cartesian product with any existing roots.
|
<X> Root<X> |
from(EntityType<X> entityType)
Create and add a query root corresponding to the given entity,
forming a cartesian product with any existing roots.
|
CommonAbstractCriteria |
getContainingQuery()
Return the query of which this is a subquery.
|
Set<Join<?,?>> |
getCorrelatedJoins()
Return the correlated joins of the subquery.
|
List<Expression<?>> |
getGroupList()
Return a list of the grouping expressions.
|
Predicate |
getGroupRestriction()
Return the predicate that corresponds to the restriction(s)
over the grouping items, or null if no restrictions have
been specified.
|
AbstractQuery<?> |
getParent()
Return the query of which this is a subquery.
|
Predicate |
getRestriction()
Return the predicate that corresponds to the where clause
restriction(s), or null if no restrictions have been
specified.
|
Class<T> |
getResultType()
Return the result type of the query or subquery.
|
Set<Root<?>> |
getRoots()
Return the query roots.
|
Expression<T> |
getSelection()
Return the selection expression.
|
Subquery<T> |
groupBy(Expression<?>... groupings)
Specify the expressions that are used to form groups over
the subquery results.
|
Subquery<T> |
groupBy(List<Expression<?>> groupings)
Specify the expressions that are used to form groups over
the subquery results.
|
Subquery<T> |
having(Expression<Boolean> expression)
Specify a restriction over the groups of the subquery.
|
Subquery<T> |
having(Predicate... predicates)
Specify restrictions over the groups of the subquery
according the conjunction of the specified restriction
predicates.
|
boolean |
isDistinct()
Return whether duplicate query results must be eliminated or
retained.
|
void |
registerParameters(ParameterRegistry registry)
Register any parameters contained within this query component with the given registry.
|
String |
render(RenderingContext renderingContext)
Render clause
|
String |
renderProjection(RenderingContext renderingContext)
Render SELECT clause
|
Subquery<T> |
select(Expression<T> expression)
Specify the item that is to be returned as the subquery
result.
|
<U> Subquery<U> |
subquery(Class<U> subqueryType)
Create a subquery of the query.
|
Subquery<T> |
where(Expression<Boolean> expression)
Modify the subquery to restrict the result according
to the specified boolean expression.
|
Subquery<T> |
where(Predicate... predicates)
Modify the subquery to restrict the result according
to the conjunction of the specified restriction predicates.
|
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, getValueHandlers, isCompoundSelection
forceConversion, getAlias, getJavaType, getValueHandler, resetJavaType, setAlias
criteriaBuilder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
as, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, isCompoundSelection
getAlias, getJavaType
getValueHandlers
getValueHandler
renderGroupBy
public CriteriaSubqueryImpl(CriteriaBuilderImpl criteriaBuilder, Class<T> javaType, CommonAbstractCriteria parent)
public AbstractQuery<?> getParent()
Subquery
public CommonAbstractCriteria getContainingQuery()
Subquery
getContainingQuery
in interface Subquery<T>
public void registerParameters(ParameterRegistry registry)
ParameterContainer
registerParameters
in interface ParameterContainer
registry
- The parameter registry with which to register.public Class<T> getResultType()
AbstractQuery
createQuery
or subquery
method, that
type will be returned. If the query was created using the
createTupleQuery
method, the result type is
Tuple
. Otherwise, the result type is
Object
.getResultType
in interface AbstractQuery<T>
public Set<Root<?>> getRoots()
AbstractQuery
CriteriaQuery
or Subquery
itself,
including any subquery roots defined as a result of
correlation. Returns empty set if no roots have been defined.
Modifications to the set do not affect the query.getRoots
in interface AbstractQuery<T>
public <X> Root<X> from(EntityType<X> entityType)
AbstractQuery
from
in interface AbstractQuery<T>
entityType
- metamodel entity representing the entity
of type Xpublic <X> Root<X> from(Class<X> entityClass)
AbstractQuery
from
in interface AbstractQuery<T>
entityClass
- the entity classpublic Subquery<T> distinct(boolean applyDistinction)
Subquery
AbstractQuery
method.public boolean isDistinct()
AbstractQuery
isDistinct
in interface AbstractQuery<T>
public Expression<T> getSelection()
Subquery
getSelection
in interface AbstractQuery<T>
getSelection
in interface Subquery<T>
public Subquery<T> select(Expression<T> expression)
Subquery
public Predicate getRestriction()
CommonAbstractCriteria
getRestriction
in interface CommonAbstractCriteria
public Subquery<T> where(Expression<Boolean> expression)
Subquery
AbstractQuery
method.public Subquery<T> where(Predicate... predicates)
Subquery
AbstractQuery
method.public List<Expression<?>> getGroupList()
AbstractQuery
getGroupList
in interface AbstractQuery<T>
public Subquery<T> groupBy(Expression<?>... groupings)
Subquery
AbstractQuery
method.public Subquery<T> groupBy(List<Expression<?>> groupings)
Subquery
AbstractQuery
method.public Predicate getGroupRestriction()
AbstractQuery
getGroupRestriction
in interface AbstractQuery<T>
public Subquery<T> having(Expression<Boolean> expression)
Subquery
AbstractQuery
method.public Subquery<T> having(Predicate... predicates)
Subquery
AbstractQuery
method.public Set<Join<?,?>> getCorrelatedJoins()
Subquery
getCorrelatedJoins
in interface Subquery<T>
public <Y> Root<Y> correlate(Root<Y> source)
Subquery
public <X,Y> Join<X,Y> correlate(Join<X,Y> source)
Subquery
public <X,Y> CollectionJoin<X,Y> correlate(CollectionJoin<X,Y> source)
Subquery
public <X,Y> SetJoin<X,Y> correlate(SetJoin<X,Y> source)
Subquery
public <X,Y> ListJoin<X,Y> correlate(ListJoin<X,Y> source)
Subquery
public <X,K,V> MapJoin<X,K,V> correlate(MapJoin<X,K,V> source)
Subquery
public <U> Subquery<U> subquery(Class<U> subqueryType)
CommonAbstractCriteria
subquery
in interface CommonAbstractCriteria
subqueryType
- the subquery result typepublic String render(RenderingContext renderingContext)
Renderable
render
in interface Renderable
renderingContext
- contextpublic String renderProjection(RenderingContext renderingContext)
Renderable
renderProjection
in interface Renderable
renderingContext
- contextCopyright © 2019 JBoss by Red Hat. All rights reserved.