Annotation Interface LookupItemsQuery


@Target({}) @Retention(RUNTIME) public @interface LookupItemsQuery
Configures lazy loading of drop-down items for LookupField with LookupType.DROPDOWN. Usable only as the LookupField.itemsQuery() member.

Either set an explicit query(), or set byInstanceName() to match items by query conditions built from the instance-name metadata of the referenced entity. If neither is set, items are loaded eagerly.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, drop-down items are matched by query conditions (Condition) built from the instance-name metadata of the referenced entity: string-typed instance-name-related attributes are matched with a case-insensitive contains condition, combined with or if there are several.
    boolean
    Whether to escape the user input for use in a like clause.
    Name of a fetch plan of the referenced entity to load items with.
    JPQL query with a mandatory :searchString parameter, for example:
    Format of the :searchString parameter value with the ${inputString} placeholder for the user input, for example "(?i)%${inputString}%".
  • Element Details

    • byInstanceName

      boolean byInstanceName
      If true, drop-down items are matched by query conditions (Condition) built from the instance-name metadata of the referenced entity: string-typed instance-name-related attributes are matched with a case-insensitive contains condition, combined with or if there are several. Works with any data store capable of loading instances, including non-persistent DTO entities in custom stores. Mutually exclusive with an explicit query() — if both are set, the explicit query wins and a warning is logged. searchStringFormat() and escapeValueForLike() do not apply in this mode: matching is always a case-insensitive substring search with the value escaped for the underlying like.
      Default:
      false
    • query

      String query
      JPQL query with a mandatory :searchString parameter, for example:
      select e from Customer e where e.name like :searchString escape '\\' order by e.name
      Empty string means "not set". Applies only when byInstanceName() is false.
      Default:
      ""
    • searchStringFormat

      String searchStringFormat
      Format of the :searchString parameter value with the ${inputString} placeholder for the user input, for example "(?i)%${inputString}%". Empty string means "not set" (raw user input is used). Applies to the explicit query() only; if set together with byInstanceName(), it is ignored and a warning is logged.
      Default:
      ""
    • escapeValueForLike

      boolean escapeValueForLike
      Whether to escape the user input for use in a like clause. The query must then contain the matching escape '\\' clause. Applies to the explicit query() only; ignored (silently) when byInstanceName() is true, where escaping is always on.
      Default:
      false
    • fetchPlan

      String fetchPlan
      Name of a fetch plan of the referenced entity to load items with. Empty string means "not set" (default is the loader's default fetch plan with an explicit query; _instance_name with byInstanceName()).
      Default:
      ""