public class LoadContext<E extends io.jmix.core.Entity>
extends io.jmix.core.LoadContext<E>
DataManager
.
Typical usage:
LoadContext<User> context = LoadContext.create(User.class).setQuery( LoadContext.createQuery("select u from sec$User u where u.login like :login") .setParameter("login", "a%") .setMaxResults(10)) .setView("user.browse"); List<User> users = dataManager.loadList(context);
Instead of using this class directly, consider fluent interface with the entry point in DataManager.load(Class)
.
Modifier and Type | Class and Description |
---|---|
static class |
LoadContext.Query
Class that defines a query to be executed for data loading.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<LoadContext.Query> |
prevQueries |
Modifier | Constructor and Description |
---|---|
protected |
LoadContext() |
|
LoadContext(java.lang.Class<E> javaClass) |
|
LoadContext(io.jmix.core.metamodel.model.MetaClass metaClass) |
Modifier and Type | Method and Description |
---|---|
LoadContext<?> |
copy()
Creates a copy of this LoadContext instance.
|
static <E extends io.jmix.core.Entity> |
create(java.lang.Class<E> entityClass)
Factory method to create a LoadContext instance.
|
static LoadContext.Query |
createQuery(java.lang.String queryString)
Factory method to create a LoadContext.Query instance for passing into
setQuery(Query) method. |
java.util.List<LoadContext.Query> |
getPrevQueries()
Allows to execute query on a previous query result.
|
LoadContext.Query |
getQuery() |
io.jmix.core.FetchPlan |
getView() |
boolean |
isLoadDynamicAttributes()
Returns true if the entity's dynamic attributes are loaded.
|
boolean |
isSoftDeletion() |
LoadContext<E> |
setAuthorizationRequired(boolean authorizationRequired) |
LoadContext<E> |
setFetchPlan(io.jmix.core.FetchPlan fetchPlan) |
LoadContext<E> |
setFetchPlan(java.lang.String fetchPlanName) |
LoadContext<E> |
setId(java.lang.Object id) |
LoadContext<E> |
setIds(java.util.Collection<?> ids) |
LoadContext<E> |
setJoinTransaction(boolean joinTransaction) |
LoadContext<E> |
setLoadDynamicAttributes(boolean loadDynamicAttributes)
Set to true to load the entity's dynamic attributes.
|
LoadContext<E> |
setLoadPartialEntities(boolean loadPartialEntities) |
LoadContext<E> |
setQuery(LoadContext.Query query) |
LoadContext<E> |
setQuery(io.jmix.core.LoadContext.Query query) |
LoadContext<E> |
setQueryKey(int queryKey) |
LoadContext.Query |
setQueryString(java.lang.String queryString) |
LoadContext<E> |
setSoftDeletion(boolean softDeletion) |
LoadContext<E> |
setView(io.jmix.core.FetchPlan fetchPlan) |
LoadContext<E> |
setView(java.lang.String fetchPlanName)
Deprecated.
replaced by
setFetchPlan(String) |
java.lang.String |
toString() |
protected java.util.List<LoadContext.Query> prevQueries
public LoadContext(io.jmix.core.metamodel.model.MetaClass metaClass)
metaClass
- metaclass of the loaded entitiespublic LoadContext(java.lang.Class<E> javaClass)
javaClass
- class of the loaded entitiesprotected LoadContext()
public static <E extends io.jmix.core.Entity> LoadContext<E> create(java.lang.Class<E> entityClass)
entityClass
- class of the loaded entitiespublic static LoadContext.Query createQuery(java.lang.String queryString)
setQuery(Query)
method.queryString
- JPQL query string. Only named parameters are supported.public LoadContext.Query getQuery()
getQuery
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setQuery(LoadContext.Query query)
query
- query definitionpublic LoadContext.Query setQueryString(java.lang.String queryString)
setQueryString
in interface io.jmix.core.DataLoadContext
setQueryString
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
queryString
- JPQL query string. Only named parameters are supported.public io.jmix.core.FetchPlan getView()
public LoadContext<E> setView(io.jmix.core.FetchPlan fetchPlan)
fetchPlan
- view that is used for loading entities@Deprecated public LoadContext<E> setView(java.lang.String fetchPlanName)
setFetchPlan(String)
public LoadContext<E> setFetchPlan(java.lang.String fetchPlanName)
fetchPlanName
- fetch plan that is used for loading entitiespublic java.util.List<LoadContext.Query> getPrevQueries()
public LoadContext<E> setQuery(io.jmix.core.LoadContext.Query query)
setQuery
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setFetchPlan(io.jmix.core.FetchPlan fetchPlan)
setFetchPlan
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setId(java.lang.Object id)
setId
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setIds(java.util.Collection<?> ids)
setIds
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setSoftDeletion(boolean softDeletion)
softDeletion
- whether to use soft deletion when loading entitiespublic boolean isSoftDeletion()
public LoadContext<E> setQueryKey(int queryKey)
setQueryKey
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public boolean isLoadDynamicAttributes()
public LoadContext<E> setLoadDynamicAttributes(boolean loadDynamicAttributes)
public LoadContext<E> setLoadPartialEntities(boolean loadPartialEntities)
setLoadPartialEntities
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<E> setAuthorizationRequired(boolean authorizationRequired)
public LoadContext<E> setJoinTransaction(boolean joinTransaction)
setJoinTransaction
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public LoadContext<?> copy()
copy
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>
public java.lang.String toString()
toString
in class io.jmix.core.LoadContext<E extends io.jmix.core.Entity>