public class InstanceLoaderImpl<E extends Entity> extends java.lang.Object implements InstanceLoader<E>
| Constructor and Description |
|---|
InstanceLoaderImpl(org.springframework.context.ApplicationContext applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
LoadContext<E> |
createLoadContext() |
Condition |
getCondition()
Returns the root condition which is used together with the query when loading entities.
|
InstanceContainer<E> |
getContainer()
Returns the container which accepts the loaded entity.
|
DataContext |
getDataContext()
Returns data context.
|
protected DataManager |
getDataManager() |
java.lang.Object |
getEntityId()
Returns id of the entity to load.
|
java.util.function.Function<LoadContext<E>,E> |
getLoadDelegate()
Returns a function which will be used to load data instead of standard implementation.
|
java.lang.Object |
getParameter(java.lang.String name)
Returns a query parameter by its name.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
Returns the map of query parameters.
|
java.lang.String |
getQuery()
Returns the query which is used for loading entities.
|
View |
getView()
Returns the view which is used when loading.
|
protected ViewRepository |
getViewRepository() |
boolean |
isLoadDynamicAttributes()
Returns true if the entity's dynamic attributes are loaded.
|
boolean |
isSoftDeletion()
Returns true if the loader respects soft deletion, i.e.
|
void |
load()
Loads data to the connected container.
|
protected boolean |
needLoad() |
void |
removeParameter(java.lang.String name)
Removes a query parameter.
|
protected View |
resolveView() |
void |
setCondition(Condition condition)
Sets the root condition which will be used together with the query when loading entities.
|
void |
setContainer(InstanceContainer<E> container)
Sets the container which accepts the loaded entity.
|
void |
setDataContext(DataContext dataContext)
Sets the data context for the loader.
|
void |
setEntityId(java.lang.Object entityId)
Sets the id of the entity to load.
|
void |
setLoadDelegate(java.util.function.Function<LoadContext<E>,E> delegate)
Sets a function which will be used to load data instead of standard implementation.
|
void |
setLoadDynamicAttributes(boolean loadDynamicAttributes)
Set to true to load the entity's dynamic attributes.
|
void |
setParameter(java.lang.String name,
java.lang.Object value)
Sets a query parameter.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Sets the map of query parameters.
|
void |
setQuery(java.lang.String query)
Sets a query which will be used for loading entities.
|
void |
setSoftDeletion(boolean softDeletion)
Set to false if you want to load softly deleted instances too.
|
void |
setView(java.lang.String viewName)
Sets the name of the view which is used when loading.
|
void |
setView(View view)
Sets the view which is used when loading.
|
public InstanceLoaderImpl(org.springframework.context.ApplicationContext applicationContext)
protected DataManager getDataManager()
protected ViewRepository getViewRepository()
@Nullable public DataContext getDataContext()
DataLoadergetDataContext in interface DataLoaderpublic void setDataContext(DataContext dataContext)
DataLoadersetDataContext in interface DataLoaderpublic void load()
DataLoaderload in interface DataLoaderprotected boolean needLoad()
public LoadContext<E> createLoadContext()
protected View resolveView()
public InstanceContainer<E> getContainer()
InstanceLoadergetContainer in interface DataLoadergetContainer in interface InstanceLoader<E extends Entity>public void setContainer(InstanceContainer<E> container)
InstanceLoadersetContainer in interface InstanceLoader<E extends Entity>public java.lang.String getQuery()
DataLoadergetQuery in interface DataLoaderpublic void setQuery(java.lang.String query)
DataLoadersetQuery in interface DataLoaderpublic Condition getCondition()
DataLoadergetCondition in interface DataLoaderpublic void setCondition(Condition condition)
DataLoadersetCondition in interface DataLoaderpublic java.util.Map<java.lang.String,java.lang.Object> getParameters()
DataLoadergetParameters in interface DataLoaderpublic void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
DataLoadersetParameters in interface DataLoaderpublic java.lang.Object getParameter(java.lang.String name)
DataLoadergetParameter in interface DataLoaderpublic void setParameter(java.lang.String name,
java.lang.Object value)
DataLoadersetParameter in interface DataLoaderpublic void removeParameter(java.lang.String name)
DataLoaderremoveParameter in interface DataLoaderpublic java.lang.Object getEntityId()
InstanceLoadergetEntityId in interface InstanceLoader<E extends Entity>public void setEntityId(java.lang.Object entityId)
InstanceLoadersetEntityId in interface InstanceLoader<E extends Entity>public boolean isSoftDeletion()
DataLoaderisSoftDeletion in interface DataLoaderpublic void setSoftDeletion(boolean softDeletion)
DataLoadersetSoftDeletion in interface DataLoaderpublic boolean isLoadDynamicAttributes()
InstanceLoaderisLoadDynamicAttributes in interface InstanceLoader<E extends Entity>public void setLoadDynamicAttributes(boolean loadDynamicAttributes)
InstanceLoadersetLoadDynamicAttributes in interface InstanceLoader<E extends Entity>public java.util.function.Function<LoadContext<E>,E> getLoadDelegate()
InstanceLoadergetLoadDelegate in interface InstanceLoader<E extends Entity>public void setLoadDelegate(java.util.function.Function<LoadContext<E>,E> delegate)
InstanceLoadersetLoadDelegate in interface InstanceLoader<E extends Entity>public View getView()
InstanceLoadergetView in interface InstanceLoader<E extends Entity>public void setView(View view)
InstanceLoadersetView in interface InstanceLoader<E extends Entity>public void setView(java.lang.String viewName)
InstanceLoadersetView in interface InstanceLoader<E extends Entity>