Eager loading

Prefetching of load objects is the process that allows you to specify in a request which related data, in an amount sufficient for the correct display of the semantics of the related object, must be loaded when executing the request.

Eager loading helps in displaying objects of the system in cases where the data is at a high level of nesting, for example, in the attributes of the “Reference” and “Collection” types.

In meta, it is used only in special cases mainly to save time resources and as an alternative to fine-tuning.

Example

You can set the eager loading for an attribute by using eagerLoading property with true or false values.

"properties": [
    {
      ...
      "eagerLoading": true,
      "formula": null
    }

Configuration

We recommend you to configure the eager loading using the deploy.json file of the project. It is appropriate for the attributes of the meta class and meta navigation. This way of configuration allows you to centrally define pre-selected attributes for many classes.

Example

"eagerLoading": {
          "node1": {
             "class1": {
                 "list": ["attr1", "attr2.attr3"],
                 "item": ["attr1", "attr2.attr3"]
              }
          }
        }

NB: If instead of "node1" put "*", then when you get from any navigation to this application object, you can use one class setting to export the object.

Configuration for export in lists and forms

The configuration of the eager loading for export in lists and forms coincides with the configuration in the deploy.json file, with only one exception. Instead of list and item, specify exportList and exportItem.

Example

"eagerLoading": {
   "class1@ns": {
     "exportList": ["attr1", "attr2.attr3"]
   },
   "class1@ns": {
      "exportItem": ["attr1", "attr2.attr3.attr4"]
   }
}

The depth of eager loading of load objects

You can specify the depth of the eager loading in the maxEagerDepth: 1 property in the deploy.json file of the project.

The maximum depth of the eager loading determines the maximum permissible level of nesting of an object.