Package io.jmix.flowui.model
Interface DataLoader
- All Known Subinterfaces:
BaseCollectionLoader,CollectionLoader<E>,InstanceLoader<E>,KeyValueCollectionLoader,KeyValueInstanceLoader
- All Known Implementing Classes:
CollectionLoaderImpl,InstanceLoaderImpl,KeyValueCollectionLoaderImpl,KeyValueInstanceLoaderImpl
@NullMarked
public interface DataLoader
The root interface in the data loaders hierarchy. Data loaders are designed to load entity instances and
collections from DataManager or custom services to data containers.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable ConditionReturns the root condition which is used together with the query when loading entities.Returns connected container.@Nullable DataContextReturns data context.getHints()default Function<DataLoader, DataLoaderMonitoringInfo> Deprecated, for removal: This API element is subject to removal in a future version.default Function<DataLoader, DataLoaderObservationInfo> Returns function that provides observation info about this data loader for the modernjmix.ui.dataObservation metric.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.voidload()Loads data to the connected container.voidremoveParameter(String name) Removes a query parameter.voidsetCondition(@Nullable Condition condition) Sets the root condition which will be used together with the query when loading entities.voidsetDataContext(@Nullable 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.default voidsetMonitoringInfoProvider(Function<DataLoader, DataLoaderMonitoringInfo> monitoringInfoProvider) Deprecated, for removal: This API element is subject to removal in a future version.UsesetObservationInfoProvider(Function)instead.default voidsetObservationInfoProvider(Function<DataLoader, DataLoaderObservationInfo> observationInfoProvider) Sets function that provides observation info about this data loader for the modernjmix.ui.dataObservation metric.voidsetParameter(String name, @Nullable 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.
-
Method Details
-
load
void load()Loads data to the connected container. -
getContainer
InstanceContainer<?> getContainer()Returns connected container. -
getDataContext
@Nullable DataContext getDataContext()Returns data context. If the data context is set, all loaded instance will be merged into it. -
setDataContext
Sets the data context for the loader. If the data context is set, all loaded instance will be merged into it. -
getQuery
String getQuery()Returns the query which is used for loading entities. -
setQuery
Sets a query which will be used for loading entities. -
getCondition
@Nullable Condition getCondition()Returns the root condition which is used together with the query when loading entities. -
setCondition
Sets the root condition which will be used together with the query when loading entities. -
getParameters
Returns the map of query parameters. -
setParameters
Sets the map of query parameters. -
getParameter
Returns a query parameter by its name. -
setParameter
Sets a query parameter. -
removeParameter
Removes a query parameter. -
setHint
Sets custom hint that should be used by the query for loading data. -
getHints
Map<String,Serializable> getHints()- Returns:
- custom hints which are used by the query for loading data.
-
setMonitoringInfoProvider
@Deprecated(since="3.0", forRemoval=true) default void setMonitoringInfoProvider(Function<DataLoader, DataLoaderMonitoringInfo> monitoringInfoProvider) Deprecated, for removal: This API element is subject to removal in a future version.UsesetObservationInfoProvider(Function)instead.Delegates tosetObservationInfoProvider(Function)so callers still using this legacy entry point get a working provider wired into the only remaining provider slot. The legacy 2-tuple(viewId, loaderId)is widened to the modern 3-tuple by leavingfragmentIdnull— fragment context cannot be recovered from a legacyDataLoaderMonitoringInfo(it does not carry it). For loaders that were historically fragment-owned the legacyviewIdslot used to carry the fragment id; that value will end up in modernview.idunchanged, which matches what the legacyjmix.ui.datadashboard sees. Callers that need separatefragment.idattribution on the modern metric should migrate tosetObservationInfoProvider(Function)directly. -
getMonitoringInfoProvider
@Deprecated(since="3.0", forRemoval=true) default Function<DataLoader,DataLoaderMonitoringInfo> getMonitoringInfoProvider()Deprecated, for removal: This API element is subject to removal in a future version.UsegetObservationInfoProvider()instead.Returns function that provides monitoring info about this data loader for the deprecated legacy Timer path. The legacy 2-tuple is derived fromgetObservationInfoProvider(): for fragment-owned loaders the fragment id folds into the single legacyviewIdslot, preserving the pre-3.0viewtag ofjmix_ui_datadashboards. -
setObservationInfoProvider
default void setObservationInfoProvider(Function<DataLoader, DataLoaderObservationInfo> observationInfoProvider) Sets function that provides observation info about this data loader for the modernjmix.ui.dataObservation metric. -
getObservationInfoProvider
Returns function that provides observation info about this data loader for the modernjmix.ui.dataObservation metric.
-
getObservationInfoProvider()instead.