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
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of this Query instance.void
copyStateTo
(LoadContext.Query query) boolean
int
int
getSort()
int
hashCode()
boolean
setCacheable
(boolean cacheable) Indicates that the query results should be cached.setCondition
(Condition condition) setFirstResult
(int firstResult) setMaxResults
(int maxResults) setParameter
(String name, Object value) 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) 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:
setParameter
in interfaceDataLoadContextQuery
- Parameters:
name
- parameter namevalue
- parameter value- Returns:
- this query instance for chaining
-
setParameter
public LoadContext.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
-
setCacheable
Indicates that the query results should be cached.- Returns:
- the same query instance
-
getFirstResult
public int getFirstResult()- Specified by:
getFirstResult
in interfaceDataLoadContextQuery
- Returns:
- results offset
-
getMaxResults
public int getMaxResults()- Specified by:
getMaxResults
in interfaceDataLoadContextQuery
- Returns:
- results limit
-
isCacheable
public boolean isCacheable() -
copy
Creates a copy of this Query instance. -
copyStateTo
-
equals
-
hashCode
public int hashCode() -
toString
-