Package io.jmix.core
Class FluentValuesLoader
java.lang.Object
io.jmix.core.FluentValuesLoader
@Component("core_FluentValuesLoader")
@Scope("prototype")
public class FluentValuesLoader
extends Object
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.jmix.core.AbstractFluentValueLoader
accessConstraints
(List<AccessConstraint<?>> accessConstraints) Sets access constraints.protected ValueLoadContext
firstResult
(int firstResult) Sets results offset.hint
(String hintName, Serializable value) Sets custom hint that should be used by the query.hints
(Map<String, Serializable> hints) Sets custom hints that should be used by the query.protected ValueLoadContext
io.jmix.core.AbstractFluentValueLoader
joinTransaction
(boolean join) 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 query parameter.Sets value for a parameter ofjava.util.Date
type.properties
(String... properties) The same as invokingproperty(String)
multiple times.properties
(List<String> properties) The same as invokingproperty(String)
multiple times.Adds a key of a returned key-value pair.void
setDataManager
(UnconstrainedDataManager dataManager) setParameters
(Map<String, Object> parameters) Sets the map of query parameters.Sets DataStore name.
-
Field Details
-
dataManager
-
-
Constructor Details
-
FluentValuesLoader
-
-
Method Details
-
createLoadContext
-
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
-
property
Adds a key of a returned key-value pair. The sequence of adding properties must conform to the sequence of result fields in the query "select" clause.For example, if the query is
select e.id, e.name from sample$Customer
and you executedproperty("customerId").property("customerName")
, the returned KeyValueEntity will contain customer identifiers in "customerId" property and names in "customerName" property. -
properties
The same as invokingproperty(String)
multiple times. -
properties
The same as invokingproperty(String)
multiple times. -
store
Sets DataStore name. -
hint
Sets custom hint that should be used by the query. -
hints
Sets custom hints that should be used by the query. -
parameter
Sets value for a query parameter.- Parameters:
name
- parameter namevalue
- parameter value
-
parameter
public FluentValuesLoader parameter(String name, Date value, jakarta.persistence.TemporalType temporalType) Sets value for a parameter ofjava.util.Date
type.- Parameters:
name
- parameter namevalue
- parameter valuetemporalType
- how to interpret the value
-
parameter
Sets value for a query parameter.- Parameters:
name
- parameter namevalue
- parameter valueimplicitConversion
- whether to do parameter value conversions, e.g. convert an entity to its ID
-
setParameters
Sets the map of query parameters. -
firstResult
Sets results offset. -
maxResults
Sets results limit. -
lockMode
Sets a lock mode to be used when executing query. -
setDataManager
-
joinTransaction
public io.jmix.core.AbstractFluentValueLoader joinTransaction(boolean join) -
accessConstraints
public io.jmix.core.AbstractFluentValueLoader accessConstraints(List<AccessConstraint<?>> accessConstraints) Sets access constraints. -
instantiateValueLoadContext
-