Package io.jmix.core
Class ValueLoadContext.Query
java.lang.Object
io.jmix.core.ValueLoadContext.Query
- All Implemented Interfaces:
DataLoadContextQuery
,Serializable
- Enclosing class:
- ValueLoadContext
public static class ValueLoadContext.Query
extends Object
implements DataLoadContextQuery, Serializable
Class that defines a query to be executed for loading values.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
String[]
getSort()
boolean
setCondition
(Condition condition) void
setDistinct
(boolean distinct) Sets whether query result should contain only unique elements ('distinct' will be added to jpql query).setFirstResult
(int firstResult) setMaxResults
(int maxResults) setParameter
(String name, Object value) Set value for a query parameter.setParameter
(String name, Object value, boolean implicitConversions) Set value for a query parameter.setParameter
(String name, Date value, javax.persistence.TemporalType temporalType) Set value for a parameter of java.util.Date type.setParameters
(Map<String, Object> parameters) void
setQueryString
(String queryString) toString()
-
Constructor Details
-
Query
- Parameters:
queryString
- JPQL query string. Only named parameters are supported.
-
-
Method Details
-
getQueryString
- Returns:
- JPQL query string
-
setQueryString
- Parameters:
queryString
- JPQL query string. Only named parameters are supported.
-
setParameter
Set value for a query parameter.- Specified by:
setParameter
in interfaceDataLoadContextQuery
- Parameters:
name
- parameter namevalue
- parameter value- Returns:
- this query instance for chaining
-
setParameter
Set value for a query parameter.- Parameters:
name
- parameter namevalue
- parameter valueimplicitConversions
- whether to do parameter value conversions, e.g. convert an entity to its ID- Returns:
- this query instance for chaining
-
setParameter
public ValueLoadContext.Query setParameter(String name, Date value, javax.persistence.TemporalType temporalType) Set value for a parameter of java.util.Date type.- Specified by:
setParameter
in interfaceDataLoadContextQuery
- Parameters:
name
- parameter namevalue
- date valuetemporalType
- temporal type- Returns:
- this query instance for chaining
-
getParameters
- Specified by:
getParameters
in interfaceDataLoadContextQuery
- Returns:
- editable map of the query parameters
-
setParameters
- Specified by:
setParameters
in interfaceDataLoadContextQuery
- Parameters:
parameters
- map of the query parameters
-
setFirstResult
- Specified by:
setFirstResult
in interfaceDataLoadContextQuery
- Parameters:
firstResult
- results offset- Returns:
- this query instance for chaining
-
setMaxResults
- Specified by:
setMaxResults
in interfaceDataLoadContextQuery
- Parameters:
maxResults
- results limit- Returns:
- this query instance for chaining
-
getCondition
- Specified by:
getCondition
in interfaceDataLoadContextQuery
- Returns:
- root query condition
-
setCondition
- Specified by:
setCondition
in interfaceDataLoadContextQuery
- Parameters:
condition
- root query condition- Returns:
- this query instance for chaining
-
getSort
- Returns:
- query sort
-
setSort
- Parameters:
sort
- query sort- Returns:
- this query instance for chaining
-
getFirstResult
public int getFirstResult()- Specified by:
getFirstResult
in interfaceDataLoadContextQuery
- Returns:
- results offset
-
getMaxResults
public int getMaxResults()- Specified by:
getMaxResults
in interfaceDataLoadContextQuery
- Returns:
- results limit
-
isDistinct
public boolean isDistinct()- Returns:
- true if query result should contain only unique elements ('distinct' will be added to jpql query), false otherwise
-
setDistinct
public void setDistinct(boolean distinct) Sets whether query result should contain only unique elements ('distinct' will be added to jpql query).- Parameters:
distinct
- flag indicating whether query result should contain only unique elements
-
getNoConversionParams
-
toString
-