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

public abstract Class CommonAbstractCriteriaImpl<T>

extends Object
implements CommonAbstractCriteria, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, jakarta.persistence.criteria.CommonAbstractCriteria
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.querydef.CriteriaDeleteImpl, org.eclipse.persistence.internal.jpa.querydef.CriteriaUpdateImpl, org.eclipse.persistence.internal.jpa.querydef.AbstractQueryImpl
Imports
java.io.Serializable, java.util.HashSet, .Set, jakarta.persistence.criteria.CommonAbstractCriteria, .Expression, .Order, .ParameterExpression, .Predicate, .Root, .Subquery, jakarta.persistence.metamodel.EntityType, .Metamodel, org.eclipse.persistence.expressions.ExpressionBuilder, org.eclipse.persistence.internal.expressions.ConstantExpression, org.eclipse.persistence.queries.DatabaseQuery

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

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

Author
Chris Delahunt
Since
EclipseLink 2.5
See Also
CommonAbstractCriteria

Field Summary

Modifier and TypeField and Description
protected Metamodel
protected Set<ParameterExpression<?>>
protected CriteriaBuilderImpl
protected Class<T>
private static final long
protected Expression<Boolean>

Constructor Summary

AccessConstructor and Description
public
CommonAbstractCriteriaImpl(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Summary

Modifier and TypeMethod and Description
public void
protected void
protected void
protected abstract Expression
protected abstract DatabaseQuery
public Set<ParameterExpression<?>>

Returns:

the query parameters
getParameters
()

Return the parameters of the query

public Predicate

Returns:

where clause predicate
getRestriction
()

Implements jakarta.persistence.criteria.CommonAbstractCriteria.getRestriction.

Return the predicate that corresponds to the where clause restriction(s).
public Class<T>

Returns:

result type
getResultType
()

Return the result type of the query.

protected abstract void
integrateRoot(RootImpl<X> root)

Used to use a root from a different query.

public Root<X>

Returns:

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

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

public Root<X>

Returns:

query root corresponding to the given entity
internalFrom
(Class<?>
the entity class
entityClass
)

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

public <U> Subquery<U>

Returns:

subquery corresponding to the query
subquery
(Class<U>
the subquery result type
type
)

Implements jakarta.persistence.criteria.CommonAbstractCriteria.subquery.

Specify that the query is to be used as a subquery having the specified return type.
public DatabaseQuery
translate()

Translates from the criteria query to a EclipseLink Database Query.

public CommonAbstractCriteria

Returns:

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

Modify the query to restrict the query results according to the specified boolean expression.

public CommonAbstractCriteria

Returns:

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

Modify the query to restrict the query results according to the conjunction of the specified restriction predicates.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

metamodelback to summary
protected Metamodel metamodel
parametersback to summary
protected Set<ParameterExpression<?>> parameters
queryBuilderback to summary
protected CriteriaBuilderImpl queryBuilder
queryTypeback to summary
protected Class<T> queryType
serialVersionUIDback to summary
private static final long serialVersionUID
whereback to summary
protected Expression<Boolean> where

Constructor Detail

CommonAbstractCriteriaImplback to summary
public CommonAbstractCriteriaImpl(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType)

Method Detail

addParameterback to summary
public void addParameter(ParameterExpression<?> parameter)
findRootAndParametersback to summary
protected void findRootAndParameters(Expression<?> predicate)
findRootAndParametersback to summary
protected void findRootAndParameters(Order order)
getBaseExpressionback to summary
protected abstract Expression getBaseExpression()
getDatabaseQueryback to summary
protected abstract DatabaseQuery getDatabaseQuery()
getParametersback to summary
public Set<ParameterExpression<?>> getParameters()

Return the parameters of the query

Returns:Set<ParameterExpression<?>>

the query parameters

getRestrictionback to summary
public Predicate getRestriction()

Implements jakarta.persistence.criteria.CommonAbstractCriteria.getRestriction.

Return the predicate that corresponds to the where clause restriction(s).

Returns:Predicate

where clause predicate

Annotations
@Override
getResultTypeback to summary
public Class<T> getResultType()

Return the result type of the query. If a result type was specified as an argument to the createQuery 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.

Returns:Class<T>

result type

integrateRootback to summary
protected abstract void integrateRoot(RootImpl<X> root)

Used to use a root from a different query.

internalFromback to summary
public Root<X> internalFrom(EntityType<X> entity)

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

internalFromback to summary
public Root<X> internalFrom(Class<?> entityClass)

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

Parameters
entityClass:Class<?>

the entity class

Returns:Root<X>

query root corresponding to the given entity

subqueryback to summary
public <U> Subquery<U> subquery(Class<U> type)

Implements jakarta.persistence.criteria.CommonAbstractCriteria.subquery.

Specify that the query is to be used as a subquery having the specified return type.

Parameters
type:Class<U>

Doc from jakarta.persistence.criteria.CommonAbstractCriteria.subquery.

the subquery result type

Returns:Subquery<U>

subquery corresponding to the query

Annotations
@Override
translateback to summary
public DatabaseQuery translate()

Translates from the criteria query to a EclipseLink Database Query.

whereback to summary
public CommonAbstractCriteria where(Expression<Boolean> restriction)

Modify the query to restrict the query results according to the specified boolean expression. Replaces the previously added restriction(s), if any.

Parameters
restriction:Expression<Boolean>

a simple or compound boolean expression

Returns:CommonAbstractCriteria

the modified query

whereback to summary
public CommonAbstractCriteria where(Predicate... restrictions)

Modify the query to restrict the query results 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.

Parameters
restrictions:Predicate[]

zero or more restriction predicates

Returns:CommonAbstractCriteria

the modified query