Package io.jmix.core
Class LoadContext.Query
java.lang.Object
io.jmix.core.LoadContext.Query
- All Implemented Interfaces:
DataLoadContextQuery,Serializable
- Enclosing class:
- LoadContext<E>
Class that defines a query to be executed for data loading.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of this Query instance.voidcopyStateTo(LoadContext.Query query) booleanintintgetSort()inthashCode()booleanbooleansetCacheable(boolean cacheable) Indicates that the query results should be cached.setCondition(Condition condition) voidsetDistinct(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, Date value, jakarta.persistence.TemporalType temporalType) Set value for a parameter of java.util.Date type.setParameters(Map<String, Object> parameters) setQueryString(String queryString) toString()
-
Constructor Details
-
Query
protected Query() -
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:
setParameterin interfaceDataLoadContextQuery- Parameters:
name- parameter namevalue- parameter value- Returns:
- this query instance for chaining
-
setParameter
public LoadContext.Query setParameter(String name, Date value, jakarta.persistence.TemporalType temporalType) Set value for a parameter of java.util.Date type.- Specified by:
setParameterin interfaceDataLoadContextQuery- Parameters:
name- parameter namevalue- date valuetemporalType- temporal type- Returns:
- this query instance for chaining
-
getParameters
- Specified by:
getParametersin interfaceDataLoadContextQuery- Returns:
- editable map of the query parameters
-
setParameters
- Specified by:
setParametersin interfaceDataLoadContextQuery- Parameters:
parameters- map of the query parameters
-
setFirstResult
- Specified by:
setFirstResultin interfaceDataLoadContextQuery- Parameters:
firstResult- results offset- Returns:
- this query instance for chaining
-
setMaxResults
- Specified by:
setMaxResultsin interfaceDataLoadContextQuery- Parameters:
maxResults- results limit- Returns:
- this query instance for chaining
-
getCondition
- Specified by:
getConditionin interfaceDataLoadContextQuery- Returns:
- root query condition
-
setCondition
- Specified by:
setConditionin 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
-
setCacheable
Indicates that the query results should be cached.- Returns:
- the same query instance
-
getFirstResult
public int getFirstResult()- Specified by:
getFirstResultin interfaceDataLoadContextQuery- Returns:
- results offset
-
getMaxResults
public int getMaxResults()- Specified by:
getMaxResultsin interfaceDataLoadContextQuery- Returns:
- results limit
-
isCacheable
public boolean isCacheable() -
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
-
copy
Creates a copy of this Query instance. -
copyStateTo
-
equals
-
hashCode
public int hashCode() -
toString
-