Package cz.cvut.kbss.jopa.model
Class CriteriaQueryImpl<T>
java.lang.Object
cz.cvut.kbss.jopa.model.CriteriaQueryImpl<T>
- All Implemented Interfaces:
CriteriaQuery<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCriteriaQueryImpl
(CriteriaQueryHolder<T> query, Metamodel metamodel, CriteriaBuilderImpl cb) -
Method Summary
Modifier and TypeMethodDescriptiondistinct()
Specify that duplicates query results will be eliminated.distinct
(boolean b) Specify whether duplicate query results will be eliminated.<X> Root<X>
from
(EntityType<X> entity) Create and add a query root corresponding to the given entity type.<X> Root<X>
Create and add a query root corresponding to the given entity class.Return the ordering expressions in order of precedence.Return the predicate that corresponds to the where clause restriction(s), or null if no restrictions have been specified.Return the selection of the query, or null if no selection has been set.groupBy
(Expression<?>... grouping) Specify the expressions that are used to form groups over the query results.groupBy
(List<Expression<?>> grouping) Specify the expressions that are used to form groups over the query results.having
(Expression<Boolean> restriction) Specify a restriction over the groups of the query.Specify restrictions over the groups of the query according the conjunction of the specified restriction predicates.boolean
Return whether duplicate query results must be eliminated or retained.Specify the ordering expressions that are used to order the query results.Specify the ordering expressions that are used to order the query results.Specify the item that is to be returned in the query result.translateQuery
(CriteriaParameterFiller parameterFiller) Method translates criteria query to SOQL query and returns its string representation.where
(Expression<Boolean> expression) Modify the query to restrict the query result according to the specified boolean expression.Modify the query to restrict the query result according to the conjunction of the specified restriction predicates.Modify the query to restrict the query result according to the conjunction of the specified restriction predicates.
-
Field Details
-
query
-
-
Constructor Details
-
CriteriaQueryImpl
-
-
Method Details
-
from
Description copied from interface:CriteriaQuery
Create and add a query root corresponding to the given entity class.- Specified by:
from
in interfaceCriteriaQuery<T>
- Parameters:
entityClass
- the entity class- Returns:
- query root corresponding to the given entity
-
from
Description copied from interface:CriteriaQuery
Create and add a query root corresponding to the given entity type.- Specified by:
from
in interfaceCriteriaQuery<T>
- Parameters:
entity
- metamodel entity representing the entity of type X- Returns:
- query root corresponding to the given entity
-
select
Description copied from interface:CriteriaQuery
Specify the item that is to be returned in the query result. Replaces the previously specified selection(s), if any.- Specified by:
select
in interfaceCriteriaQuery<T>
- Parameters:
selection
- - selection specifying the item that is to be returned in the query result- Returns:
- the modified query
-
where
Description copied from interface:CriteriaQuery
Modify the query to restrict the query result according to the specified boolean expression. Replaces the previously added restriction(s), if any.- Specified by:
where
in interfaceCriteriaQuery<T>
- Parameters:
expression
- - a simple or compound boolean expression- Returns:
- the modified query
-
where
Description copied from interface:CriteriaQuery
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.- Specified by:
where
in interfaceCriteriaQuery<T>
- Parameters:
predicates
- - zero or more restriction predicates- Returns:
- the modified query
-
where
Description copied from interface:CriteriaQuery
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.- Specified by:
where
in interfaceCriteriaQuery<T>
- Parameters:
predicates
- - list of predicates- Returns:
- the modified query
-
getResultType
- Specified by:
getResultType
in interfaceCriteriaQuery<T>
-
distinct
Description copied from interface:CriteriaQuery
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.- Specified by:
distinct
in interfaceCriteriaQuery<T>
- Parameters:
b
- - boolean value specifying whether duplicate results must be eliminated from the query result or whether they must be retained- Returns:
- the modified query
-
distinct
Description copied from interface:CriteriaQuery
Specify that duplicates query results will be eliminated.- Specified by:
distinct
in interfaceCriteriaQuery<T>
- Returns:
- the modified query
-
isDistinct
public boolean isDistinct()Description copied from interface:CriteriaQuery
Return whether duplicate query results must be eliminated or retained.- Specified by:
isDistinct
in interfaceCriteriaQuery<T>
- Returns:
- boolean indicating whether duplicate query results must be eliminated
-
getSelection
Description copied from interface:CriteriaQuery
Return the selection of the query, or null if no selection has been set.- Specified by:
getSelection
in interfaceCriteriaQuery<T>
- Returns:
- selection item
-
getRestriction
Description copied from interface:CriteriaQuery
Return the predicate that corresponds to the where clause restriction(s), or null if no restrictions have been specified.- Specified by:
getRestriction
in interfaceCriteriaQuery<T>
- Returns:
- where clause predicate
-
orderBy
Description copied from interface: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 highest precedence.- Specified by:
orderBy
in interfaceCriteriaQuery<T>
- Parameters:
o
- list of zero or more ordering expressions- Returns:
- the modified query
-
orderBy
Description copied from interface: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 highest precedence.- Specified by:
orderBy
in interfaceCriteriaQuery<T>
- Parameters:
o
- zero or more ordering expressions- Returns:
- the modified query
-
getOrderList
Description copied from interface:CriteriaQuery
Return the ordering expressions in order of precedence. Returns empty list if no ordering expressions have been specified.- Specified by:
getOrderList
in interfaceCriteriaQuery<T>
- Returns:
- the list of ordering expressions
-
groupBy
Description copied from interface:CriteriaQuery
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.- Specified by:
groupBy
in interfaceCriteriaQuery<T>
- Parameters:
grouping
- zero or more grouping expressions- Returns:
- the modified query
-
groupBy
Description copied from interface:CriteriaQuery
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.- Specified by:
groupBy
in interfaceCriteriaQuery<T>
- Parameters:
grouping
- list of zero or more grouping expressions- Returns:
- the modified query
-
having
Description copied from interface:CriteriaQuery
Specify a restriction over the groups of the query. Replaces the previous having restriction(s), if any.- Specified by:
having
in interfaceCriteriaQuery<T>
- Parameters:
restriction
- a simple or compound boolean expression- Returns:
- the modified query
-
having
Description copied from interface:CriteriaQuery
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.- Specified by:
having
in interfaceCriteriaQuery<T>
- Parameters:
restrictions
- zero or more restriction predicates- Returns:
- the modified query
-
translateQuery
Method translates criteria query to SOQL query and returns its string representation.- Parameters:
parameterFiller
- Generator of parameter values in the query string- Returns:
- string representation of SOQL query
-