Package io.jmix.core
Class FluentLoader.ByQuery<E>
java.lang.Object
io.jmix.core.FluentLoader.ByQuery<E>
- Enclosing class:
- FluentLoader<E>
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedByQuery(FluentLoader<E> loader, String queryString, Object[] positionalParams, org.springframework.context.ApplicationContext applicationContext) protectedByQuery(FluentLoader<E> loader, String queryString, org.springframework.context.ApplicationContext applicationContext) 
- 
Method SummaryModifier and TypeMethodDescriptionaccessConstraints(Class<? extends AccessConstraint> accessConstraintsClass) Adds registered access constraints that are subclasses of the given class.accessConstraints(Collection<AccessConstraint<?>> accessConstraints) Adds access constraints.cacheable(boolean cacheable) Indicates that the query results should be cached.Sets additional query condition.Sets a fetch plan.Sets a fetchPlan by name.fetchPlan(Consumer<FetchPlanBuilder> fetchPlanBuilderConfigurer) Configure the fetch plan.fetchPlanProperties(String... properties) Sets a fetch plan containing the given properties.firstResult(int firstResult) Sets results offset.hint(String hintName, Serializable value) Adds custom hint that should be used by the query.hints(Map<String, Serializable> hints) Adds custom hints that should be used by the query.joinTransaction(boolean join) Indicates that the operation must be performed in an existing transaction if it exists.list()Loads a list of entities.lockMode(jakarta.persistence.LockModeType lockMode) Sets a lock mode to be used when executing query.maxResults(int maxResults) Sets results limit.one()Loads a single instance.optional()Loads a single instance and wraps it in Optional.Sets value for a query parameter.Sets value for a parameter ofjava.util.Datetype.parameters(Map<String, Object> parameters) Adds the given parameters to the map of query parameters.Sets sorting, for examplesort(Sort.by("name"))
- 
Constructor Details- 
ByQueryprotected ByQuery(FluentLoader<E> loader, String queryString, org.springframework.context.ApplicationContext applicationContext) 
- 
ByQueryprotected ByQuery(FluentLoader<E> loader, String queryString, Object[] positionalParams, org.springframework.context.ApplicationContext applicationContext) 
 
- 
- 
Method Details- 
listLoads a list of entities.
- 
optionalLoads a single instance and wraps it in Optional.
- 
oneLoads a single instance.- Throws:
- NoResultException- if nothing was loaded
 
- 
fetchPlanSets a fetch plan.
- 
fetchPlanSets a fetchPlan by name.
- 
fetchPlanConfigure the fetch plan.
- 
fetchPlanPropertiesSets a fetch plan containing the given properties. A property can be designated by a path in the entity graph. For example:dataManager.load(Pet.class) .query("...") .fetchPlanProperties( "name", "owner.name", "owner.address.city") .list();
- 
hintAdds custom hint that should be used by the query.
- 
hintsAdds custom hints that should be used by the query.
- 
conditionSets additional query condition.
- 
parameterSets value for a query parameter.- Parameters:
- name- parameter name
- value- parameter value
 
- 
parameterpublic FluentLoader.ByQuery<E> parameter(String name, @Nullable Date value, jakarta.persistence.TemporalType temporalType) Sets value for a parameter ofjava.util.Datetype.- Parameters:
- name- parameter name
- value- parameter value
- temporalType- how to interpret the value
 
- 
parametersAdds the given parameters to the map of query parameters.
- 
firstResultSets results offset.
- 
maxResultsSets results limit.
- 
sortSets sorting, for examplesort(Sort.by("name"))
- 
cacheableIndicates that the query results should be cached. By default, queries are not cached.
- 
accessConstraintsAdds access constraints.
- 
accessConstraintspublic FluentLoader.ByQuery<E> accessConstraints(Class<? extends AccessConstraint> accessConstraintsClass) Adds registered access constraints that are subclasses of the given class.
- 
joinTransactionIndicates that the operation must be performed in an existing transaction if it exists. True by default.
- 
lockModeSets a lock mode to be used when executing query.
 
-