Interface JpqlFilter<V>

Type Parameters:
V - value type
All Superinterfaces:
Component, Component.BelongToFrame, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, FilterComponent, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasValue<V>, Requirable, SingleFilterComponent<V>, SupportsCaptionPosition, Validatable
All Known Implementing Classes:
JpqlFilterImpl

public interface JpqlFilter<V> extends SingleFilterComponent<V>
JpqlFilter is a UI component used for filtering entities returned by the DataLoader. The component contains JPQL expressions that will be added to the 'from' and 'where' data loader query sections. The component can automatically render proper layout for setting a condition value. In general case a JpqlFilter layout contains a label with caption and a field for editing a condition value.
  • Field Details

  • Method Details

    • getQueryCondition

      JpqlCondition getQueryCondition()
      Specified by:
      getQueryCondition in interface FilterComponent
      Returns:
      a JpqlCondition related to the current JpqlFilter
    • getParameterClass

      Class getParameterClass()
      Returns:
      a Java class of the associated query parameter
    • setParameterClass

      @StudioProperty(type=JAVA_CLASS_NAME, required=true, typeParameter="V") void setParameterClass(Class parameterClass)
      Sets a Java class of the associated query parameter.
      Parameters:
      parameterClass - a Java class of the associated query parameter
    • getWhere

      String getWhere()
      Returns a a JPQL expression which will be added to the 'where' data loader query section.

      The {E} placeholder should be used in the expression instead of the alias of the entity being selected. The condition can only have one parameter denoted by ? if used.

      Example of selecting Car entities by an attribute of the joined Repair collection:

       r.description like ?
       
      Returns:
      a JPQL expression which will be added to the 'where' data loader query section
      See Also:
    • getJoin

      @Nullable String getJoin()
      Returns a JPQL expression which will be added to the 'from' data loader query section.

      This can be required to create a complex condition based on an attribute of a related collection. The expression should be started with join or left join statements.

      The {E} placeholder should be used in the expression instead of the alias of the entity being selected.

      Example of joining the Repair collection when selecting Car entities:

       join {E}.repairs r
       
      Returns:
      a JPQL expression which will be added to the 'from' data loader query section
      See Also:
    • setCondition

      void setCondition(String where, @Nullable String join)
      Sets JPQL expressions which will be added to the data loader query 'from' and 'where' sections.
      Parameters:
      where - a JPQL expression which will be added to the 'where' data loader query section
      join - a JPQL expression which will be added to the 'from' data loader query section
      See Also:
    • setHasInExpression

      @StudioProperty(defaultValue="false") void setHasInExpression(boolean hasInExpression)
      Sets whether the query condition has an IN expression and the value is a collection.
      Parameters:
      hasInExpression - whether the query condition has an IN expression
    • hasInExpression

      boolean hasInExpression()
      Returns:
      whether the query condition has an IN expression and the value is a collection