CriteriaQuery interface defines functionality that is
specific to top-level queries.
| Modifier and Type | Method and Description |
|---|---|
| public CriteriaQuery | Returns: the modified query.boolean value specifying whether duplicate
results must be eliminated from the query result or
whether they must be retained distinct)Redeclares jakarta. Specify whether duplicate query results are eliminated. |
| public List | Returns: the list of ordering expressionsReturn the ordering expressions in order of precedence. |
| public CriteriaQuery | Returns: the modified queryzero or more grouping expressions grouping)Redeclares jakarta. Specify the expressions that are used to form groups over the query results. |
| public CriteriaQuery | Returns: the modified querylist of zero or more grouping expressions grouping)Redeclares jakarta. Specify the expressions that are used to form groups over the query results. |
| public CriteriaQuery | Returns: the modified querya simple or compound boolean expression restriction)Redeclares jakarta. Specify a restriction over the groups of the query. |
| public CriteriaQuery | Returns: the modified queryzero or more restriction predicates restrictions)Redeclares jakarta. Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. |
| public CriteriaQuery | Returns: the modified querya list of zero or more restriction predicates restrictions)Redeclares jakarta. Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates. |
| public CriteriaQuery | Returns: the modified queryselection items corresponding to the
results to be returned by the query selections)
Deprecated
since 3.2. Since this method is not typesafe, the use of
CriteriaBuilder#array or CriteriaBuilder#tuple
with select is strongly preferred.
Specify the selection items that are to be returned in the query result. |
| public CriteriaQuery | Returns: the modified querylist of selection items corresponding
to the results to be returned by the
query selectionList)
Deprecated
since 3.2. Since this method is not typesafe, the use of
CriteriaBuilder#array or CriteriaBuilder#tuple
with select is strongly preferred.
Specify the selection items that are to be returned in the query result. |
| public CriteriaQuery | |
| public CriteriaQuery | |
| public CriteriaQuery | |
| public CriteriaQuery | Returns: the modified querya simple or compound boolean expression restriction)Redeclares jakarta. Modify the query to restrict the query result according to the specified boolean expression. |
| public CriteriaQuery | Returns: the modified queryzero or more restriction predicates restrictions)Redeclares jakarta. Modify the query to restrict the query result according to the conjunction of the specified restriction predicates. |
| public CriteriaQuery | Returns: the modified querya list of zero or more restriction predicates restrictions)Redeclares jakarta. Modify the query to restrict the query result according to the conjunction of the specified restriction predicates. |
| distinct | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. Specify whether duplicate query results are 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
| |
| getOrderList | back to summary |
|---|---|
| public List 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. | |
| groupBy | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. 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 Redeclares jakarta. 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
| |
| having | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. 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 Redeclares jakarta. 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
| |
| having | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. 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
| |
| multiselect | back to summary |
|---|---|
| public CriteriaQuery Deprecated since 3.2. Since this method is not typesafe, the use of
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 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 Deprecated since 3.2. Since this method is not typesafe, the use of
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 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 the highest precedence.
| |
| orderBy | back to summary |
|---|---|
| public CriteriaQuery 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 the highest precedence.
| |
| select | back to summary |
|---|---|
| public CriteriaQuery 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"));
| |
| where | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. 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 Redeclares jakarta. 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
| |
| where | back to summary |
|---|---|
| public CriteriaQuery Redeclares jakarta. 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
| |