class CriteriaQueryImpl<T> extends Object implements OpenJPACriteriaQuery<T>, AliasContext
| Constructor and Description |
|---|
CriteriaQueryImpl(MetamodelImpl model,
Class<T> resultClass) |
CriteriaQueryImpl(MetamodelImpl model,
SubqueryImpl<T> delegator)
Used by a subquery to delegate to this receiver.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addRoot(RootImpl<?> root) |
void |
assertRoot() |
void |
assertSelection() |
OpenJPACriteriaQuery<T> |
compile()
Compiles to verify that at least one root is defined, a selection term is present
and, most importantly, collects all the parameters so that they can be bound to
the executable query.
|
(package private) Context |
ctx()
Gets the current context.
|
javax.persistence.criteria.CriteriaQuery<T> |
distinct(boolean distinct)
Sets whether this query as distinct.
|
boolean |
equals(Object other) |
<X> javax.persistence.criteria.Root<X> |
from(Class<X> cls) |
<X> javax.persistence.criteria.Root<X> |
from(javax.persistence.metamodel.EntityType<X> entity) |
String |
getAlias(javax.persistence.criteria.Selection<?> selection)
Gets the alias of the given node.
|
Map<javax.persistence.criteria.Selection<?>,String> |
getAliases() |
(package private) CriteriaQueryImpl<?> |
getAncestor()
Gets either this query itself if this is not a captive query for
a subquery.
|
(package private) Stack<Context> |
getContexts()
Gets the stack of contexts used by this query.
|
(package private) SubqueryImpl<?> |
getDelegator()
Gets the subquery, if any, which is delegating to this receiver.
|
(package private) CriteriaQueryImpl<?> |
getDelegatorParent() |
List<javax.persistence.criteria.Expression<?>> |
getGroupList() |
PredicateImpl |
getGroupRestriction() |
MetamodelImpl |
getMetamodel()
Gets the metamodel which defines the scope of all persistent entity references.
|
List<javax.persistence.criteria.Order> |
getOrderList()
Gets the list of ordering elements.
|
Set<javax.persistence.criteria.ParameterExpression<?>> |
getParameters() |
OrderedMap<Object,Class<?>> |
getParameterTypes()
Return map where key is the parameter expression itself and value is the expected type.
|
(package private) QueryExpressions |
getQueryExpressions(ExpressionFactory factory)
Populate a kernel expression tree by translating the components of this
receiver with the help of the given
ExpressionFactory. |
Value |
getRegisteredRootVariable(javax.persistence.criteria.Root<?> root)
Gets the registered variable for the given root.
|
Value |
getRegisteredValue(javax.persistence.criteria.Selection<?> selection)
Gets the registered path value for the given node.
|
Value |
getRegisteredVariable(javax.persistence.criteria.Selection<?> selection)
Gets the registered variable for the given node.
|
PredicateImpl |
getRestriction() |
Class<T> |
getResultType() |
javax.persistence.criteria.Root<?> |
getRoot() |
(package private) javax.persistence.criteria.Root<?> |
getRoot(boolean mustExist) |
Set<javax.persistence.criteria.Root<?>> |
getRoots() |
javax.persistence.criteria.Selection<T> |
getSelection()
Return the selection of the query
|
List<javax.persistence.criteria.Selection<?>> |
getSelectionList()
Return the selection items of the query as a list
|
javax.persistence.criteria.CriteriaQuery<T> |
groupBy(javax.persistence.criteria.Expression<?>... grouping) |
javax.persistence.criteria.CriteriaQuery<T> |
groupBy(List<javax.persistence.criteria.Expression<?>> grouping) |
javax.persistence.criteria.CriteriaQuery<T> |
having(javax.persistence.criteria.Expression<Boolean> restriction) |
javax.persistence.criteria.CriteriaQuery<T> |
having(javax.persistence.criteria.Predicate... restrictions) |
(package private) void |
invalidateCompilation() |
protected boolean |
isDefaultProjection() |
boolean |
isDistinct()
Affirms if selection of this query is distinct.
|
(package private) boolean |
isMultiselect() |
boolean |
isRegistered(javax.persistence.criteria.Selection<?> selection)
Affirms if the given node has been registered.
|
javax.persistence.criteria.CriteriaQuery<T> |
multiselect(List<javax.persistence.criteria.Selection<?>> list) |
javax.persistence.criteria.CriteriaQuery<T> |
multiselect(javax.persistence.criteria.Selection<?>... selections)
Specify the items that are to be returned in the query result.
|
javax.persistence.criteria.CriteriaQuery<T> |
orderBy(List<javax.persistence.criteria.Order> orders) |
javax.persistence.criteria.CriteriaQuery<T> |
orderBy(javax.persistence.criteria.Order... orders) |
(package private) void |
registerParameter(ParameterExpressionImpl<?> p)
Registers the given parameter.
|
(package private) void |
registerRoot(javax.persistence.criteria.Root<?> root,
Value var)
Registers a variable for the given root expression.
|
void |
registerVariable(javax.persistence.criteria.Selection<?> node,
Value var,
Value path)
Register the given variable of given path value against the given node.
|
(package private) void |
render(StringBuilder buffer,
Set<javax.persistence.criteria.Root<?>> roots,
List<javax.persistence.criteria.Join<?,?>> correlatedJoins) |
javax.persistence.criteria.CriteriaQuery<T> |
select(javax.persistence.criteria.Selection<? extends T> selection)
Specify the item that is to be returned in the query result.
|
(package private) void |
setContexts(Stack<Context> contexts) |
<U> javax.persistence.criteria.Subquery<U> |
subquery(Class<U> type) |
String |
toCQL()
Gets the string representation of the query.
|
String |
toString()
Returns a JPQL-like string, if this receiver is populated.
|
javax.persistence.criteria.CriteriaQuery<T> |
where(javax.persistence.criteria.Expression<Boolean> restriction) |
javax.persistence.criteria.CriteriaQuery<T> |
where(javax.persistence.criteria.Predicate... restrictions) |
public CriteriaQueryImpl(MetamodelImpl model, Class<T> resultClass)
CriteriaQueryImpl(MetamodelImpl model, SubqueryImpl<T> delegator)
model - the metamodel defines the scope of all persistent entity references.delegator - the subquery which will delegate to this receiver.SubqueryImpl<?> getDelegator()
public MetamodelImpl getMetamodel()
public javax.persistence.criteria.CriteriaQuery<T> distinct(boolean distinct)
public List<javax.persistence.criteria.Order> getOrderList()
getOrderList in interface javax.persistence.criteria.CriteriaQuery<T>public javax.persistence.criteria.Selection<T> getSelection()
getSelection in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.CriteriaQuery<T> multiselect(javax.persistence.criteria.Selection<?>... selections)
multiselect in interface javax.persistence.criteria.CriteriaQuery<T>selections - expressions specifying the items that
are returned in the query resultvoid registerParameter(ParameterExpressionImpl<?> p)
public Set<javax.persistence.criteria.ParameterExpression<?>> getParameters()
getParameters in interface javax.persistence.criteria.CriteriaQuery<T>public List<javax.persistence.criteria.Selection<?>> getSelectionList()
public javax.persistence.criteria.CriteriaQuery<T> groupBy(javax.persistence.criteria.Expression<?>... grouping)
public javax.persistence.criteria.CriteriaQuery<T> groupBy(List<javax.persistence.criteria.Expression<?>> grouping)
public javax.persistence.criteria.CriteriaQuery<T> having(javax.persistence.criteria.Expression<Boolean> restriction)
public javax.persistence.criteria.CriteriaQuery<T> having(javax.persistence.criteria.Predicate... restrictions)
public javax.persistence.criteria.CriteriaQuery<T> orderBy(javax.persistence.criteria.Order... orders)
orderBy in interface javax.persistence.criteria.CriteriaQuery<T>public javax.persistence.criteria.CriteriaQuery<T> orderBy(List<javax.persistence.criteria.Order> orders)
orderBy in interface javax.persistence.criteria.CriteriaQuery<T>public javax.persistence.criteria.CriteriaQuery<T> select(javax.persistence.criteria.Selection<? extends T> selection)
select in interface javax.persistence.criteria.CriteriaQuery<T>selection - selection specifying the item that
is to be returned in the query resultpublic javax.persistence.criteria.CriteriaQuery<T> where(javax.persistence.criteria.Expression<Boolean> restriction)
public javax.persistence.criteria.CriteriaQuery<T> where(javax.persistence.criteria.Predicate... restrictions)
public <X> javax.persistence.criteria.Root<X> from(javax.persistence.metamodel.EntityType<X> entity)
from in interface javax.persistence.criteria.AbstractQuery<T>public <X> javax.persistence.criteria.Root<X> from(Class<X> cls)
from in interface javax.persistence.criteria.AbstractQuery<T>public List<javax.persistence.criteria.Expression<?>> getGroupList()
getGroupList in interface javax.persistence.criteria.AbstractQuery<T>public PredicateImpl getGroupRestriction()
getGroupRestriction in interface javax.persistence.criteria.AbstractQuery<T>public PredicateImpl getRestriction()
getRestriction in interface javax.persistence.criteria.AbstractQuery<T>public Set<javax.persistence.criteria.Root<?>> getRoots()
getRoots in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.Root<?> getRoot()
javax.persistence.criteria.Root<?> getRoot(boolean mustExist)
void addRoot(RootImpl<?> root)
public boolean isDistinct()
isDistinct in interface javax.persistence.criteria.AbstractQuery<T>public <U> javax.persistence.criteria.Subquery<U> subquery(Class<U> type)
subquery in interface javax.persistence.criteria.AbstractQuery<T>public OrderedMap<Object,Class<?>> getParameterTypes()
QueryExpressions getQueryExpressions(ExpressionFactory factory)
ExpressionFactory.public void assertRoot()
public void assertSelection()
CriteriaQueryImpl<?> getAncestor()
Context ctx()
public String getAlias(javax.persistence.criteria.Selection<?> selection)
getAlias in interface AliasContextpublic void registerVariable(javax.persistence.criteria.Selection<?> node,
Value var,
Value path)
registerVariable in interface AliasContextnode - of query treevar - must be a variablepublic boolean isRegistered(javax.persistence.criteria.Selection<?> selection)
AliasContextisRegistered in interface AliasContextpublic Value getRegisteredVariable(javax.persistence.criteria.Selection<?> selection)
AliasContextgetRegisteredVariable in interface AliasContextpublic Value getRegisteredValue(javax.persistence.criteria.Selection<?> selection)
AliasContextgetRegisteredValue in interface AliasContextvoid registerRoot(javax.persistence.criteria.Root<?> root,
Value var)
root - var - public Value getRegisteredRootVariable(javax.persistence.criteria.Root<?> root)
getRegisteredRootVariable in interface AliasContextCriteriaQueryImpl<?> getDelegatorParent()
public Class<T> getResultType()
getResultType in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.CriteriaQuery<T> multiselect(List<javax.persistence.criteria.Selection<?>> list)
multiselect in interface javax.persistence.criteria.CriteriaQuery<T>boolean isMultiselect()
protected boolean isDefaultProjection()
void invalidateCompilation()
public OpenJPACriteriaQuery<T> compile()
compile in interface OpenJPACriteriaQuery<T>public String toCQL()
toCQL in interface OpenJPACriteriaQuery<T>void render(StringBuilder buffer, Set<javax.persistence.criteria.Root<?>> roots, List<javax.persistence.criteria.Join<?,?>> correlatedJoins)
public String toString()
Object.toString().Copyright © 2006–2015 Apache Software Foundation. All rights reserved.