Package io.jmix.core
Class FluentLoader.ByCondition<E>
java.lang.Object
io.jmix.core.FluentLoader.ByCondition<E>
- Enclosing class:
- FluentLoader<E>
-
Constructor Summary
ModifierConstructorDescriptionprotected
ByCondition
(FluentLoader.ByQuery<E> byQuery, Condition condition) protected
ByCondition
(FluentLoader<E> loader, String entityName, Condition condition) -
Method Summary
Modifier 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 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.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.Date
type.parameters
(Map<String, Object> parameters) Adds the given parameters to the map of query parameters.Sets sorting, for examplesort(Sort.by("name"))
-
Constructor Details
-
ByCondition
-
ByCondition
-
-
Method Details
-
list
Loads a list of entities. -
optional
Loads a single instance and wraps it in Optional. -
one
Loads a single instance.- Throws:
IllegalStateException
- if nothing was loaded
-
fetchPlan
Sets a fetch plan. -
fetchPlan
Sets a fetchPlan by name. -
fetchPlan
Configure the fetch plan. -
fetchPlanProperties
Sets 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) .condition(...) .fetchPlanProperties( "name", "owner.name", "owner.address.city") .list();
-
hint
Adds custom hint that should be used by the query. -
hints
Adds custom hints that should be used by the query. -
parameter
Sets value for a query parameter.- Parameters:
name
- parameter namevalue
- parameter value
-
parameter
public FluentLoader.ByCondition<E> parameter(String name, Date value, javax.persistence.TemporalType temporalType) Sets value for a parameter ofjava.util.Date
type.- Parameters:
name
- parameter namevalue
- parameter valuetemporalType
- how to interpret the value
-
parameters
Adds the given parameters to the map of query parameters. -
firstResult
Sets results offset. -
maxResults
Sets results limit. -
sort
Sets sorting, for examplesort(Sort.by("name"))
-
cacheable
Indicates that the query results should be cached. By default, queries are not cached. -
accessConstraints
public FluentLoader.ByCondition<E> accessConstraints(Collection<AccessConstraint<?>> accessConstraints) Adds access constraints. -
accessConstraints
public FluentLoader.ByCondition<E> accessConstraints(Class<? extends AccessConstraint> accessConstraintsClass) Adds registered access constraints that are subclasses of the given class. -
joinTransaction
Indicates that the operation must be performed in an existing transaction if it exists. True by default.
-