Annotation Interface LookupField


@Retention(RUNTIME) @Target({TYPE,FIELD}) public @interface LookupField
Defines which UI component is used for selecting references to an entity.

On an entity class, applies whenever a reference to this entity is selected in generated UI (form fields, property filters, etc.). Propagates to subclasses. On a reference attribute, applies to this attribute only and takes precedence over both the class-level annotation on the referenced entity and the jmix.ui.component.entity-field-fqn / entity-field-actions application properties. The application properties in turn take precedence over the class-level annotation.

With LookupType.DROPDOWN and no itemsQuery(), all instances are loaded eagerly — suitable for small dictionary entities only. For larger tables configure lazy loading via itemsQuery(). Items are loaded through DataManager, so row-level security constraints apply.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional list of picker action ids registered in the UI module's actions registry, for example:
    Optional query configuration for lazy loading of LookupType.DROPDOWN items.
  • Element Details

    • type

    • actions

      String[] actions
      Optional list of picker action ids registered in the UI module's actions registry, for example:
      @LookupField(type = LookupType.DROPDOWN, actions = {"entity_lookup", "entity_open"})
      Default:
      {}
    • itemsQuery

      LookupItemsQuery itemsQuery
      Optional query configuration for lazy loading of LookupType.DROPDOWN items. Ignored (with a warning in the log) for LookupType.VIEW.
      Default:
      @io.jmix.core.entity.annotation.LookupItemsQuery