Class FilterComponentBuilder.JpqlFilterBuilder<V>

java.lang.Object
io.jmix.flowui.component.genericfilter.FilterComponentBuilder.JpqlFilterBuilder<V>
Type Parameters:
V - the value type (Boolean for a void/checkbox filter, or the parameter type)
Enclosing class:
FilterComponentBuilder

public static class FilterComponentBuilder.JpqlFilterBuilder<V> extends Object
Fluent builder for JpqlFilter.
  • Field Details

    • filter

      protected final GenericFilter filter
    • parameterClass

      protected final Class<?> parameterClass
    • metadata

      protected Metadata metadata
    • filterComponents

      protected FilterComponents filterComponents
    • jpqlFilterSupport

      protected JpqlFilterSupport jpqlFilterSupport
    • where

      protected String where
    • join

      protected String join
    • parameterName

      protected String parameterName
    • defaultValue

      protected V defaultValue
    • label

      protected String label
    • hasInExpression

      protected boolean hasInExpression
    • built

      protected boolean built
  • Constructor Details

    • JpqlFilterBuilder

      protected JpqlFilterBuilder(GenericFilter filter, org.springframework.context.ApplicationContext applicationContext, Class<?> parameterClass)
  • Method Details

    • autowireDependencies

      protected void autowireDependencies(org.springframework.context.ApplicationContext applicationContext)
    • where

      Sets the JPQL WHERE clause fragment (use {E} as the entity alias and ? as the parameter placeholder). Required.
    • join

      public FilterComponentBuilder.JpqlFilterBuilder<V> join(@Nullable String join)
      Sets the optional JPQL JOIN clause fragment (e.g. "join {E}.tags t").
    • parameterName

      public FilterComponentBuilder.JpqlFilterBuilder<V> parameterName(String parameterName)
      Sets the query parameter name. Optional — if not set, a name is generated automatically (matching the behaviour of the XML loader). Set it explicitly only when the WHERE clause uses a named bind parameter (:paramName) that must match a specific name.
    • defaultValue

      public FilterComponentBuilder.JpqlFilterBuilder<V> defaultValue(@Nullable V defaultValue)
      Sets the default (pre-filled) value. Optional.

      For a void (checkbox) filter the value type is Boolean: defaultValue(true) makes the condition active by default.

    • label

      public FilterComponentBuilder.JpqlFilterBuilder<V> label(@Nullable String label)
      Overrides the auto-generated label text. Optional.
    • hasInExpression

      public FilterComponentBuilder.JpqlFilterBuilder<V> hasInExpression(boolean hasInExpression)
      Marks the condition as having an IN expression (the value is a collection).
    • build

      public JpqlFilter<V> build()
      Builds and returns the configured JpqlFilter.
      Throws:
      IllegalStateException - if where was not set, if the owning filter has no DataLoader, or if this builder instance has already been used