Module org.eclipse.persistence.jpa
Class CommonAbstractCriteriaImpl<T>
java.lang.Object
org.eclipse.persistence.internal.jpa.querydef.CommonAbstractCriteriaImpl<T>
- All Implemented Interfaces:
CommonAbstractCriteria
,Serializable
- Direct Known Subclasses:
AbstractQueryImpl
,CriteriaDeleteImpl
,CriteriaUpdateImpl
public abstract class CommonAbstractCriteriaImpl<T>
extends Object
implements CommonAbstractCriteria, Serializable
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.
- Since:
- EclipseLink 2.5
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Metamodel
protected Set
<ParameterExpression<?>> protected CriteriaBuilderImpl
protected Expression
<Boolean> -
Constructor Summary
ConstructorDescriptionCommonAbstractCriteriaImpl
(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(ParameterExpression<?> parameter) protected void
findRootAndParameters
(Expression<?> predicate) protected void
findRootAndParameters
(Order order) protected abstract Expression
protected abstract DatabaseQuery
Return the parameters of the queryReturn the predicate that corresponds to the where clause restriction(s).Return the result type of the query.protected abstract void
integrateRoot
(RootImpl root) Used to use a root from a different query.internalFrom
(EntityType entity) Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.internalFrom
(Class<?> entityClass) Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.<U> Subquery
<U> Specify that the query is to be used as a subquery having the specified return type.Translates from the criteria query to a EclipseLink Database Query.where
(Expression<Boolean> restriction) Modify the query to restrict the query results according to the specified boolean expression.Modify the query to restrict the query results according to the conjunction of the specified restriction predicates.
-
Field Details
-
metamodel
-
where
-
queryBuilder
-
queryType
-
parameters
-
-
Constructor Details
-
CommonAbstractCriteriaImpl
public CommonAbstractCriteriaImpl(Metamodel metamodel, CriteriaBuilderImpl queryBuilder, Class<T> resultType)
-
-
Method Details
-
getRestriction
Return the predicate that corresponds to the where clause restriction(s).- Specified by:
getRestriction
in interfaceCommonAbstractCriteria
- Returns:
- where clause predicate
-
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:
- result type
-
internalFrom
Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.- Parameters:
entity
- metamodel entity representing the entity of type X- Returns:
- query root corresponding to the given entity
-
internalFrom
Add a query root corresponding to the given entity, forming a Cartesian product with any existing roots.- Parameters:
entityClass
- the entity class- Returns:
- query root corresponding to the given entity
-
where
Modify the query to restrict the query results according to the specified boolean expression. Replaces the previously added restriction(s), if any.- Parameters:
restriction
- a simple or compound boolean expression- Returns:
- the modified query
-
where
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
- zero or more restriction predicates- Returns:
- the modified query
-
subquery
Specify that the query is to be used as a subquery having the specified return type.- Specified by:
subquery
in interfaceCommonAbstractCriteria
- Returns:
- subquery corresponding to the query
-
integrateRoot
Used to use a root from a different query. -
findRootAndParameters
-
findRootAndParameters
-
getBaseExpression
-
addParameter
-
getDatabaseQuery
-
getParameters
Return the parameters of the query- Returns:
- the query parameters
-
translate
Translates from the criteria query to a EclipseLink Database Query.
-