@Component(value="core_FluentValuesLoader")
@Scope(value="prototype")
public class FluentValuesLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected UnconstrainedDataManager |
dataManager |
Constructor and Description |
---|
FluentValuesLoader(java.lang.String queryString) |
Modifier and Type | Method and Description |
---|---|
io.jmix.core.AbstractFluentValueLoader |
accessConstraints(java.util.List<AccessConstraint<?>> accessConstraints)
Sets access constraints.
|
protected ValueLoadContext |
createLoadContext() |
FluentValuesLoader |
firstResult(int firstResult)
Sets results offset.
|
FluentValuesLoader |
hint(java.lang.String hintName,
java.io.Serializable value)
Sets custom hint that should be used by the query.
|
FluentValuesLoader |
hints(java.util.Map<java.lang.String,java.io.Serializable> hints)
Sets custom hints that should be used by the query.
|
protected ValueLoadContext |
instantiateValueLoadContext() |
io.jmix.core.AbstractFluentValueLoader |
joinTransaction(boolean join) |
java.util.List<KeyValueEntity> |
list()
Loads a list of entities.
|
FluentValuesLoader |
maxResults(int maxResults)
Sets results limit.
|
KeyValueEntity |
one()
Loads a single instance.
|
java.util.Optional<KeyValueEntity> |
optional()
Loads a single instance and wraps it in Optional.
|
FluentValuesLoader |
parameter(java.lang.String name,
java.util.Date value,
javax.persistence.TemporalType temporalType)
Sets value for a parameter of
java.util.Date type. |
FluentValuesLoader |
parameter(java.lang.String name,
java.lang.Object value)
Sets value for a query parameter.
|
FluentValuesLoader |
parameter(java.lang.String name,
java.lang.Object value,
boolean implicitConversion)
Sets value for a query parameter.
|
FluentValuesLoader |
properties(java.util.List<java.lang.String> properties)
The same as invoking
property(String) multiple times. |
FluentValuesLoader |
properties(java.lang.String... properties)
The same as invoking
property(String) multiple times. |
FluentValuesLoader |
property(java.lang.String name)
Adds a key of a returned key-value pair.
|
void |
setDataManager(UnconstrainedDataManager dataManager) |
FluentValuesLoader |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets the map of query parameters.
|
FluentValuesLoader |
store(java.lang.String store)
Sets DataStore name.
|
protected UnconstrainedDataManager dataManager
protected ValueLoadContext createLoadContext()
public java.util.List<KeyValueEntity> list()
public java.util.Optional<KeyValueEntity> optional()
public KeyValueEntity one()
java.lang.IllegalStateException
- if nothing was loadedpublic FluentValuesLoader property(java.lang.String name)
For example, if the query is select e.id, e.name from sample$Customer
and you executed property("customerId").property("customerName")
, the returned KeyValueEntity
will contain customer identifiers in "customerId" property and names in "customerName" property.
public FluentValuesLoader properties(java.util.List<java.lang.String> properties)
property(String)
multiple times.public FluentValuesLoader properties(java.lang.String... properties)
property(String)
multiple times.public FluentValuesLoader store(java.lang.String store)
public FluentValuesLoader hint(java.lang.String hintName, java.io.Serializable value)
public FluentValuesLoader hints(java.util.Map<java.lang.String,java.io.Serializable> hints)
public FluentValuesLoader parameter(java.lang.String name, java.lang.Object value)
name
- parameter namevalue
- parameter valuepublic FluentValuesLoader parameter(java.lang.String name, java.util.Date value, javax.persistence.TemporalType temporalType)
java.util.Date
type.name
- parameter namevalue
- parameter valuetemporalType
- how to interpret the valuepublic FluentValuesLoader parameter(java.lang.String name, java.lang.Object value, boolean implicitConversion)
name
- parameter namevalue
- parameter valueimplicitConversion
- whether to do parameter value conversions, e.g. convert an entity to its IDpublic FluentValuesLoader setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
public FluentValuesLoader firstResult(int firstResult)
public FluentValuesLoader maxResults(int maxResults)
public void setDataManager(UnconstrainedDataManager dataManager)
public io.jmix.core.AbstractFluentValueLoader joinTransaction(boolean join)
public io.jmix.core.AbstractFluentValueLoader accessConstraints(java.util.List<AccessConstraint<?>> accessConstraints)
protected ValueLoadContext instantiateValueLoadContext()