Package io.jmix.core
Class FluentLoader<E>
java.lang.Object
io.jmix.core.FluentLoader<E>
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionall()
Load all instances.Load by condition.protected void
Load by entity identifier.Load by array of entity identifiers.ids
(Collection ids) Load by collection of entity identifiers.protected LoadContext<E>
instantiateLoadContext
(MetaClass metaClass) Load by query.Load by query with positional parameters (e.g.void
setDataManager
(UnconstrainedDataManager dataManager)
-
Field Details
-
applicationContext
@Autowired protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
FluentLoader
-
-
Method Details
-
setDataManager
-
instantiateLoadContext
-
createFetchPlanBuilder
protected void createFetchPlanBuilder() -
id
Load by entity identifier.For example:
Customer customer = dataManager.load(Customer.class) .id(someId) .one(); Optional<Customer> customer = dataManager.load(Customer.class) .id(someId) .optional();
-
ids
Load by array of entity identifiers.For example:
List<Customer> customers = dataManager.load(Customer.class) .ids(id1, id2) .list();
Entities in the result list have the same order as provided identifiers. If an instance from the list cannot be loaded for some reason, the whole operation fails withEntityAccessException
. -
ids
Load by collection of entity identifiers.For example:
List<Customer> customers = dataManager.load(Customer.class) .ids(idCollection) .list();
Entities in the result list have the same order as provided identifiers. If an instance from the list cannot be loaded for some reason, the whole operation fails withEntityAccessException
. -
query
Load by query.For example:
List<Customer> customers = dataManager.load(Customer.class) .query("select c from Customer c where c.name like :name") .parameter("name", "(?i)%doe%") // case-insensitive substring search .maxResults(100) .list();
- See Also:
-
query
Load by query with positional parameters (e.g."e.name = ?1 and e.status = ?2"
).Always use
e
as the entity alias.For example:
List<Customer> customers = dataManager.load(Customer.class) .query("e.name like ?1", "(?i)%doe%") // case-insensitive substring search .maxResults(100) .list();
-
condition
Load by condition.For example:
List<Customer> customers = dataManager.load(Customer.class) .condition(PropertyCondition.contains("name", "(?i)%doe%")) // case-insensitive substring search .maxResults(100) .list();
-
all
Load all instances.For example:
List<Customer> customers = dataManager.load(Customer.class) .all() .maxResults(100) .list();
-