Package io.jmix.flowui.model.impl
Class KeyValueInstanceLoaderImpl
java.lang.Object
io.jmix.flowui.model.impl.KeyValueInstanceLoaderImpl
- All Implemented Interfaces:
DataLoader,KeyValueInstanceLoader
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.model.KeyValueInstanceLoader
KeyValueInstanceLoader.PostLoadEvent, KeyValueInstanceLoader.PreLoadEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Conditionprotected KeyValueContainerprotected DataContextprotected DataManagerprotected Function<ValueLoadContext,KeyValueEntity> protected EventHubprotected Map<String,Serializable> protected io.micrometer.core.instrument.MeterRegistryprotected Function<DataLoader,DataLoaderMonitoringInfo> protected Stringprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a listener toKeyValueInstanceLoader.PostLoadEvent.Adds a listener toKeyValueInstanceLoader.PreLoadEvent.ReturnsValueLoadContextwhich is created by the parameters of this loader.Returns the root condition which is used together with the query when loading entities.Returns the container which accepts loaded entities.Returns data context.getHints()Returns a function which will be used to load data instead of standard implementation.Returns function that provides monitoring info about this data loader.getParameter(String name) Returns a query parameter by its name.Returns the map of query parameters.getQuery()Returns the query which is used for loading entities.Returns data store name.voidload()Loads data to the connected container.voidremoveParameter(String name) Removes a query parameter.protected voidsendPostLoadEvent(KeyValueEntity entity) protected booleansendPreLoadEvent(ValueLoadContext loadContext) voidsetCondition(Condition condition) Sets the root condition which will be used together with the query when loading entities.voidsetContainer(KeyValueContainer container) Sets the container which accepts loaded entities.voidsetDataContext(DataContext dataContext) Sets the data context for the loader.voidsetHint(String hintName, Serializable value) Sets custom hint that should be used by the query for loading data.voidsetLoadDelegate(Function<ValueLoadContext, KeyValueEntity> delegate) Sets a function which will be used to load data instead of standard implementation.voidsetMonitoringInfoProvider(Function<DataLoader, DataLoaderMonitoringInfo> monitoringInfoProvider) Sets function that provides monitoring info about this data loader.voidsetParameter(String name, Object value) Sets a query parameter.voidsetParameters(Map<String, Object> parameters) Sets the map of query parameters.voidSets a query which will be used for loading entities.voidsetStoreName(String name) Sets the data store name.
-
Field Details
-
dataManager
-
meterRegistry
@Autowired protected io.micrometer.core.instrument.MeterRegistry meterRegistry -
dataContext
-
container
-
query
-
condition
-
parameters
-
hints
-
storeName
-
delegate
-
events
-
monitoringInfoProvider
-
-
Constructor Details
-
KeyValueInstanceLoaderImpl
public KeyValueInstanceLoaderImpl()
-
-
Method Details
-
getDataContext
Description copied from interface:DataLoaderReturns data context. If the data context is set, all loaded instance will be merged into it.- Specified by:
getDataContextin interfaceDataLoader
-
setDataContext
Description copied from interface:DataLoaderSets the data context for the loader. If the data context is set, all loaded instance will be merged into it.- Specified by:
setDataContextin interfaceDataLoader
-
setMonitoringInfoProvider
public void setMonitoringInfoProvider(Function<DataLoader, DataLoaderMonitoringInfo> monitoringInfoProvider) Description copied from interface:DataLoaderSets function that provides monitoring info about this data loader.- Specified by:
setMonitoringInfoProviderin interfaceDataLoader
-
getMonitoringInfoProvider
Description copied from interface:DataLoaderReturns function that provides monitoring info about this data loader.- Specified by:
getMonitoringInfoProviderin interfaceDataLoader
-
load
public void load()Description copied from interface:DataLoaderLoads data to the connected container.- Specified by:
loadin interfaceDataLoader
-
createLoadContext
Description copied from interface:KeyValueInstanceLoaderReturnsValueLoadContextwhich is created by the parameters of this loader. TheValueLoadContextcan be used withDataManagerto load data by the same conditions.- Specified by:
createLoadContextin interfaceKeyValueInstanceLoader
-
sendPreLoadEvent
-
sendPostLoadEvent
-
getContainer
Description copied from interface:KeyValueInstanceLoaderReturns the container which accepts loaded entities.- Specified by:
getContainerin interfaceDataLoader- Specified by:
getContainerin interfaceKeyValueInstanceLoader
-
setContainer
Description copied from interface:KeyValueInstanceLoaderSets the container which accepts loaded entities.- Specified by:
setContainerin interfaceKeyValueInstanceLoader
-
getQuery
Description copied from interface:DataLoaderReturns the query which is used for loading entities.- Specified by:
getQueryin interfaceDataLoader
-
setQuery
Description copied from interface:DataLoaderSets a query which will be used for loading entities.- Specified by:
setQueryin interfaceDataLoader
-
getCondition
Description copied from interface:DataLoaderReturns the root condition which is used together with the query when loading entities.- Specified by:
getConditionin interfaceDataLoader
-
setCondition
Description copied from interface:DataLoaderSets the root condition which will be used together with the query when loading entities.- Specified by:
setConditionin interfaceDataLoader
-
getParameters
Description copied from interface:DataLoaderReturns the map of query parameters.- Specified by:
getParametersin interfaceDataLoader
-
setParameters
Description copied from interface:DataLoaderSets the map of query parameters.- Specified by:
setParametersin interfaceDataLoader
-
getParameter
Description copied from interface:DataLoaderReturns a query parameter by its name.- Specified by:
getParameterin interfaceDataLoader
-
setParameter
Description copied from interface:DataLoaderSets a query parameter.- Specified by:
setParameterin interfaceDataLoader
-
removeParameter
Description copied from interface:DataLoaderRemoves a query parameter.- Specified by:
removeParameterin interfaceDataLoader
-
setHint
Description copied from interface:DataLoaderSets custom hint that should be used by the query for loading data.- Specified by:
setHintin interfaceDataLoader
-
getHints
- Specified by:
getHintsin interfaceDataLoader- Returns:
- custom hints which are used by the query for loading data.
-
getLoadDelegate
Description copied from interface:KeyValueInstanceLoaderReturns a function which will be used to load data instead of standard implementation.- Specified by:
getLoadDelegatein interfaceKeyValueInstanceLoader
-
setLoadDelegate
Description copied from interface:KeyValueInstanceLoaderSets a function which will be used to load data instead of standard implementation.- Specified by:
setLoadDelegatein interfaceKeyValueInstanceLoader
-
addPreLoadListener
Description copied from interface:KeyValueInstanceLoaderAdds a listener toKeyValueInstanceLoader.PreLoadEvent.You can also add an event listener declaratively using a controller method annotated with
Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(KeyValueInstanceLoader.PreLoadEvent event) { // handle event here }- Specified by:
addPreLoadListenerin interfaceKeyValueInstanceLoader- Parameters:
listener- listener- Returns:
- subscription
-
addPostLoadListener
Description copied from interface:KeyValueInstanceLoaderAdds a listener toKeyValueInstanceLoader.PostLoadEvent.You can also add an event listener declaratively using a controller method annotated with
Subscribe:@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(KeyValueInstanceLoader.PostLoadEvent event) { // handle event here }- Specified by:
addPostLoadListenerin interfaceKeyValueInstanceLoader- Parameters:
listener- listener- Returns:
- subscription
-
getStoreName
Description copied from interface:KeyValueInstanceLoaderReturns data store name.- Specified by:
getStoreNamein interfaceKeyValueInstanceLoader
-
setStoreName
Description copied from interface:KeyValueInstanceLoaderSets the data store name. By default, the main data store is used.- Specified by:
setStoreNamein interfaceKeyValueInstanceLoader
-