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

public abstract Class AbstractQueryImpl<T>

extends CommonAbstractCriteriaImpl<T>
implements AbstractQuery<T>
Class Inheritance
All Implemented Interfaces
jakarta.persistence.criteria.AbstractQuery, jakarta.persistence.criteria.CommonAbstractCriteria
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.querydef.CriteriaQueryImpl, org.eclipse.persistence.internal.jpa.querydef.SubQueryImpl
Imports
java.util.ArrayList, .HashSet, .List, .Set, jakarta.persistence.criteria.AbstractQuery, .Expression, .Predicate, .Root, jakarta.persistence.metamodel.EntityType, .Metamodel, org.eclipse.persistence.expressions.ExpressionBuilder

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

Description: This is the container class for the components that define a query. This is the superclass of both the CriteriaQuery and the SubQuery.

Author
gyorke
Since
EclipseLink 1.2
See Also
CriteriaQuery

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum

Field Summary

Modifier and TypeField and Description
protected Expression
protected boolean
protected List<Expression<?>>
protected Predicate
protected AbstractQueryImpl.ResultType
protected Set<Root<?>>
private static final long
Inherited from org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl:
metamodelparametersqueryBuilderqueryTypewhere

Constructor Summary

AccessConstructor and Description
public
AbstractQueryImpl(Metamodel metamodel, AbstractQueryImpl.ResultType queryResult, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Summary

Modifier and TypeMethod and Description
public abstract void
addJoin(FromImpl<Z, X> join)

public AbstractQuery<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
)

Implements jakarta.persistence.criteria.AbstractQuery.distinct.

Specify whether duplicate query results will be eliminated.
protected void
findJoins(FromImpl<Z, X> root)

public <X> Root<X>

Returns:

query root corresponding to the given entity
from
(EntityType<X>
metamodel entity representing the entity of type X
entity
)

Implements jakarta.persistence.criteria.AbstractQuery.from.

Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.
public <X> Root<X>

Returns:

query root corresponding to the given entity
from
(Class<X>
the entity class
entityClass
)

Implements jakarta.persistence.criteria.AbstractQuery.from.

Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.
protected Expression
protected Expression
public List<Expression<?>>

Returns:

the list of grouping expressions
getGroupList
()

Implements jakarta.persistence.criteria.AbstractQuery.getGroupList.

Return a list of the grouping expressions
public Predicate

Returns:

having clause predicate
getGroupRestriction
()

Implements jakarta.persistence.criteria.AbstractQuery.getGroupRestriction.

Return the predicate that corresponds to the restriction(s) over the grouping items.
public Set<Root<?>>

Returns:

the set of query roots
getRoots
()

Implements jakarta.persistence.criteria.AbstractQuery.getRoots.

Return the query roots.
public AbstractQuery<T>

Returns:

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

Implements jakarta.persistence.criteria.AbstractQuery.groupBy.

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

Returns:

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

Implements jakarta.persistence.criteria.AbstractQuery.groupBy.

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

Returns:

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

Implements jakarta.persistence.criteria.AbstractQuery.having.

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

Returns:

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

Implements jakarta.persistence.criteria.AbstractQuery.having.

Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates.
protected void
integrateRoot(RootImpl<X> root)

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Used to use a root from a different query.
public boolean

Returns:

boolean indicating whether duplicate query results must be eliminated
isDistinct
()

Implements jakarta.persistence.criteria.AbstractQuery.isDistinct.

Return whether duplicate query results must be eliminated or retained.
public AbstractQuery<T>

Returns:

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

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

Implements jakarta.persistence.criteria.AbstractQuery.where.

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

Returns:

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

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

Implements 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.CommonAbstractCriteriaImpl:
addParameterfindRootAndParametersfindRootAndParametersgetDatabaseQuerygetParametersgetRestrictiongetResultTypeinternalFrominternalFromsubquerytranslate

Field Detail

baseExpressionback to summary
protected Expression baseExpression
distinctback to summary
protected boolean distinct
groupByback to summary
protected List<Expression<?>> groupBy
havingClauseback to summary
protected Predicate havingClause
queryResultback to summary
protected AbstractQueryImpl.ResultType queryResult
rootsback to summary
protected Set<Root<?>> roots
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.serialVersionUID.

Constructor Detail

AbstractQueryImplback to summary
public AbstractQueryImpl(Metamodel metamodel, AbstractQueryImpl.ResultType queryResult, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Detail

addJoinback to summary
public abstract void addJoin(FromImpl<Z, X> join)
distinctback to summary
public AbstractQuery<T> distinct(boolean distinct)

Implements jakarta.persistence.criteria.AbstractQuery.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:AbstractQuery<T>

the modified query.

Annotations
@Override
findJoinsback to summary
protected void findJoins(FromImpl<Z, X> root)
fromback to summary
public <X> Root<X> from(EntityType<X> entity)

Implements jakarta.persistence.criteria.AbstractQuery.from.

Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.

Parameters
entity:EntityType<X>

metamodel entity representing the entity of type X

Returns:Root<X>

query root corresponding to the given entity

Annotations
@Override
fromback to summary
public <X> Root<X> from(Class<X> entityClass)

Implements jakarta.persistence.criteria.AbstractQuery.from.

Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.

Parameters
entityClass:Class<X>

the entity class

Returns:Root<X>

query root corresponding to the given entity

Annotations
@Override
getBaseExpressionback to summary
protected Expression getBaseExpression()

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.getBaseExpression.

Annotations
@Override
getBaseExpressionback to summary
protected Expression getBaseExpression(Root<X> root)
getGroupListback to summary
public List<Expression<?>> getGroupList()

Implements jakarta.persistence.criteria.AbstractQuery.getGroupList.

Return a list of the grouping expressions

Returns:List<Expression<?>>

the list of grouping expressions

Annotations
@Override
getGroupRestrictionback to summary
public Predicate getGroupRestriction()

Implements jakarta.persistence.criteria.AbstractQuery.getGroupRestriction.

Return the predicate that corresponds to the restriction(s) over the grouping items.

Returns:Predicate

having clause predicate

Annotations
@Override
getRootsback to summary
public Set<Root<?>> getRoots()

Implements jakarta.persistence.criteria.AbstractQuery.getRoots.

Return the query roots.

Returns:Set<Root<?>>

the set of query roots

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

Implements jakarta.persistence.criteria.AbstractQuery.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.

Parameters
grouping:List<Expression<?>>

list of zero or more grouping expressions

Returns:AbstractQuery<T>

the modified query

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

Implements jakarta.persistence.criteria.AbstractQuery.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.

Parameters
grouping:Expression<?>[]

zero or more grouping expressions

Returns:AbstractQuery<T>

the modified query

Annotations
@Override
havingback to summary
public AbstractQuery<T> having(Expression<Boolean> restriction)

Implements jakarta.persistence.criteria.AbstractQuery.having.

Specify a restriction over the groups of the query. Replaces the previous having restriction(s), if any.

Parameters
restriction:Expression<Boolean>

a simple or compound boolean expression

Returns:AbstractQuery<T>

the modified query

Annotations
@Override
havingback to summary
public AbstractQuery<T> having(Predicate... restrictions)

Implements jakarta.persistence.criteria.AbstractQuery.having.

Specify restrictions over the groups of the query according 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.

Parameters
restrictions:Predicate[]

zero or more restriction predicates

Returns:AbstractQuery<T>

the modified query

Annotations
@Override
integrateRootback to summary
protected void integrateRoot(RootImpl<X> root)

Implements abstract org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Doc from org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl.integrateRoot.

Used to use a root from a different query.

Annotations
@Override
isDistinctback to summary
public boolean isDistinct()

Implements jakarta.persistence.criteria.AbstractQuery.isDistinct.

Return whether duplicate query results must be eliminated or retained.

Returns:boolean

boolean indicating whether duplicate query results must be eliminated

Annotations
@Override
whereback to summary
public AbstractQuery<T> where(Expression<Boolean> restriction)

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

Implements jakarta.persistence.criteria.AbstractQuery.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:AbstractQuery<T>

the modified query

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

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

Implements jakarta.persistence.criteria.AbstractQuery.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:AbstractQuery<T>

the modified query

Annotations
@Override
org.eclipse.persistence.internal.jpa.querydef back to summary

protected final Enum AbstractQueryImpl.ResultType

extends Enum<AbstractQueryImpl.ResultType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType
public static final AbstractQueryImpl.ResultType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static AbstractQueryImpl.ResultType
public static AbstractQueryImpl.ResultType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONSTRUCTORback to summary
public static final AbstractQueryImpl.ResultType CONSTRUCTOR
ENTITYback to summary
public static final AbstractQueryImpl.ResultType ENTITY
OBJECT_ARRAYback to summary
public static final AbstractQueryImpl.ResultType OBJECT_ARRAY
OTHERback to summary
public static final AbstractQueryImpl.ResultType OTHER
PARTIALback to summary
public static final AbstractQueryImpl.ResultType PARTIAL
TUPLEback to summary
public static final AbstractQueryImpl.ResultType TUPLE
UNKNOWNback to summary
public static final AbstractQueryImpl.ResultType UNKNOWN

Constructor Detail

ResultTypeback to summary
private ResultType()

Method Detail

valueOfback to summary
public static AbstractQueryImpl.ResultType valueOf(String name)
valuesback to summary
public static AbstractQueryImpl.ResultType[] values()