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 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

      void setDataContext(@Nullable DataContext dataContext)
      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

      void setQuery(String query)
      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

      void setCondition(@Nullable Condition condition)
      Sets the root condition which will be used together with the query when loading entities.
    • getParameters

      Map<String,Object> getParameters()
      Returns the map of query parameters.
    • setParameters

      void setParameters(Map<String,Object> parameters)
      Sets the map of query parameters.
    • getParameter

      Object getParameter(String name)
      Returns a query parameter by its name.
    • setParameter

      void setParameter(String name, @Nullable Object value)
      Sets a query parameter.
    • removeParameter

      void removeParameter(String name)
      Removes a query parameter.
    • setHint

      void setHint(String hintName, Serializable value)
      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.
      Delegates to setObservationInfoProvider(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 leaving fragmentId null — fragment context cannot be recovered from a legacy DataLoaderMonitoringInfo (it does not carry it). For loaders that were historically fragment-owned the legacy viewId slot used to carry the fragment id; that value will end up in modern view.id unchanged, which matches what the legacy jmix.ui.data dashboard sees. Callers that need separate fragment.id attribution on the modern metric should migrate to setObservationInfoProvider(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.
      Returns function that provides monitoring info about this data loader for the deprecated legacy Timer path. The legacy 2-tuple is derived from getObservationInfoProvider(): for fragment-owned loaders the fragment id folds into the single legacy viewId slot, preserving the pre-3.0 view tag of jmix_ui_data dashboards.
    • setObservationInfoProvider

      default void setObservationInfoProvider(Function<DataLoader,DataLoaderObservationInfo> observationInfoProvider)
      Sets function that provides observation info about this data loader for the modern jmix.ui.data Observation metric.
    • getObservationInfoProvider

      default Function<DataLoader,DataLoaderObservationInfo> getObservationInfoProvider()
      Returns function that provides observation info about this data loader for the modern jmix.ui.data Observation metric.