CriteriaQuery contract. Mostly a set of delegation to its
internal QueryStructure.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private List | |
| private final QueryStructure | |
| private final Class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public CriteriaQuery | distinct(boolean
boolean value specifying whether duplicate
results must be eliminated from the query result or
whether they must be retained applyDistinction)Implements javax. |
| public <X> Root | from(EntityType<X>
metamodel entity representing the entity
of type X entityType)Implements javax. |
| public <X> Root | from(Class<X>
the entity class entityClass)Implements javax. |
| public List | getGroupList()
Implements javax. |
| public Predicate | getGroupRestriction()
Implements javax. |
| public List | getOrderList()
Implements javax. |
| public Set | getParameters()
Implements javax. |
| protected QueryStructure | |
| public Predicate | getRestriction()
Implements javax. |
| public Class | getResultType()
Implements javax. |
| public Set | |
| public Selection | getSelection()
Implements javax. |
| public CriteriaQuery | groupBy(Expression<?>...
zero or more grouping expressions groupings)Implements javax. |
| public CriteriaQuery | groupBy(List<Expression<?>>
list of zero or more grouping expressions groupings)Implements javax. |
| private boolean | Returns: True if there is an explicit selection; false otherwise.If no explicit selection was defined, we have a condition called an implicit selection if the query specified
a single |
| public CriteriaQuery | having(Expression<Boolean>
a simple or compound boolean expression expression)Implements javax. |
| public CriteriaQuery | having(Predicate...
zero or more restriction predicates predicates)Implements javax. |
| public CriteriaInterpretation | interpret(RenderingContext renderingContext)
Implements org. |
| public boolean | isDistinct()
Implements javax. |
| public CriteriaQuery | multiselect(Selection<?>...
selection items corresponding to the
results to be returned by the query selections)Implements javax. |
| public CriteriaQuery | multiselect(List<Selection<?>>
list of selection items corresponding
to the results to be returned by the query selections)Implements javax. |
| public CriteriaQuery | orderBy(Order...
zero or more ordering expressions orders)Implements javax. |
| public CriteriaQuery | orderBy(List<Order>
list of zero or more ordering expressions orders)Implements javax. |
| protected void | |
| public CriteriaQuery | select(Selection<? extends T>
selection specifying the item that
is to be returned in the query result selection)Implements javax. |
| public <U> Subquery | subquery(Class<U>
the subquery result type subqueryType)Implements javax. |
| public void | |
| public CriteriaQuery | where(Expression<Boolean>
a simple or compound boolean expression expression)Implements javax. |
| public CriteriaQuery | where(Predicate...
zero or more restriction predicates predicates)Implements javax. |
| log | back to summary |
|---|---|
| private static final Logger log | |
| orderSpecs | back to summary |
|---|---|
| private List<Order> orderSpecs | |
| queryStructure | back to summary |
|---|---|
| private final QueryStructure<T> queryStructure | |
| returnType | back to summary |
|---|---|
| private final Class<T> returnType | |
| CriteriaQueryImpl | back to summary |
|---|---|
| public CriteriaQueryImpl(CriteriaBuilderImpl criteriaBuilder, Class<T> returnType) | |
| applySelection | back to summary |
|---|---|
| public void applySelection(Selection<? extends T> selection) | |
| distinct | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. 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
| |
| from | back to summary |
|---|---|
| public <X> Root Implements javax. Doc from javax. Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots.
| |
| from | back to summary |
|---|---|
| public <X> Root Implements javax. Doc from javax. Create and add a query root corresponding to the given entity, forming a cartesian product with any existing roots. | |
| getGroupList | back to summary |
|---|---|
| public List Implements javax. Doc from javax. Return a list of the grouping expressions. Returns empty list if no grouping expressions have been specified. Modifications to the list do not affect the query.
| |
| getGroupRestriction | back to summary |
|---|---|
| public Predicate getGroupRestriction() Implements javax. Doc from javax. Return the predicate that corresponds to the restriction(s) over the grouping items, or null if no restrictions have been specified. | |
| getOrderList | back to summary |
|---|---|
| public List Implements javax. Doc from javax. Return the ordering expressions in order of precedence. Returns empty list if no ordering expressions have been specified. Modifications to the list do not affect the query. | |
| getParameters | back to summary |
|---|---|
| public Set Implements javax. Doc from javax. Return the parameters of the query. Returns empty set if there are no parameters. Modifications to the set do not affect the query.
| |
| getQueryStructure | back to summary |
|---|---|
| protected QueryStructure | |
| getRestriction | back to summary |
|---|---|
| public Predicate getRestriction() Implements javax. Doc from javax. Return the predicate that corresponds to the where clause restriction(s), or null if no restrictions have been specified. | |
| getResultType | back to summary |
|---|---|
| public Class Implements javax. Doc from javax. Return the result type of the query or subquery. If a result
type was specified as an argument to the
| |
| getRoots | back to summary |
|---|---|
| public Set Implements javax. Doc from javax. Return the query roots. These are the roots that have
been defined for the | |
| getSelection | back to summary |
|---|---|
| public Selection Implements javax. Doc from javax. Return the selection of the query, or null if no selection has been set.
| |
| groupBy | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. 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.
This method only overrides the return type of the
corresponding
| |
| groupBy | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. 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.
This method only overrides the return type of the
corresponding
| |
| hasImplicitSelection | back to summary |
|---|---|
| private boolean hasImplicitSelection() If no explicit selection was defined, we have a condition called an implicit selection if the query specified
a single
| |
| having | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify a restriction over the groups of the query.
Replaces the previous having restriction(s), if any.
This method only overrides the return type of the
corresponding
| |
| having | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify restrictions over the groups of the query
according the conjunction of the specified restriction
predicates.
Replaces the previously added having 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
| |
| interpret | back to summary |
|---|---|
| public CriteriaInterpretation interpret(RenderingContext renderingContext) Implements org.
| |
| isDistinct | back to summary |
|---|---|
| public boolean isDistinct() Implements javax. Doc from javax. Return whether duplicate query results must be eliminated or retained.
| |
| multiselect | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify the selection items that are to be returned in the query result. Replaces the previously specified selection(s), if any. The type of the result of the query execution depends on the specification of the type of the criteria query object created as well as the arguments to the multiselect method. An argument to the multiselect method must not be a tuple- or array-valued compound selection item. The semantics of this method are as follows:
| |
| multiselect | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify the selection items that are to be returned in the query result. Replaces the previously specified selection(s), if any. The type of the result of the query execution depends on
the specification of the type of the criteria query object
created as well as the argument to the The semantics of this method are as follows:
| |
| orderBy | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous ordering, if any, is simply removed, and results will be returned in no particular order. The left-to-right sequence of the ordering expressions determines the precedence, whereby the leftmost has highest precedence.
| |
| orderBy | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify the ordering expressions that are used to order the query results. Replaces the previous ordering expressions, if any. If no ordering expressions are specified, the previous ordering, if any, is simply removed, and results will be returned in no particular order. The order of the ordering expressions in the list determines the precedence, whereby the first element in the list has highest precedence.
| |
| renderOrderByClause | back to summary |
|---|---|
| protected void renderOrderByClause(RenderingContext renderingContext, StringBuilder jpaqlBuffer) | |
| select | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. Specify the item that is to be returned in the query result. Replaces the previously specified selection(s), if any. Note Applications using the string-based API may need to specify the type of the select item when it results from a get or join operation and the query result type is specified.
For example:
CriteriaQuery<String> q = cb.createQuery(String.class);
Root<Order> order = q.from(Order.class);
q.select(order.get("shippingAddress").<String>get("state"));
CriteriaQuery<Product> q2 = cb.createQuery(Product.class);
q2.select(q2.from(Order.class)
.join("items")
.<Item,Product>join("product"));
| |
| subquery | back to summary |
|---|---|
| public <U> Subquery Implements javax. Doc from javax. Create a subquery of the query. | |
| validate | back to summary |
|---|---|
| public void validate() Implements org.
| |
| where | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. 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
| |
| where | back to summary |
|---|---|
| public CriteriaQuery Implements javax. Doc from javax. 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
| |