Package io.jmix.ui.component
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
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.HasValue
HasValue.ValueChangeEvent<V>Nested classes/interfaces inherited from interface io.jmix.ui.component.SupportsCaptionPosition
SupportsCaptionPosition.CaptionPosition -
Field Summary
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptiongetJoin()Returns a JPQL expression which will be added to the 'from' data loader query section.getWhere()Returns a a JPQL expression which will be added to the 'where' data loader query section.booleanvoidsetCondition(String where, String join) Sets JPQL expressions which will be added to the data loader query 'from' and 'where' sections.voidsetHasInExpression(boolean hasInExpression) Sets whether the query condition has an IN expression and the value is a collection.voidsetParameterClass(Class parameterClass) Sets a Java class of the associated query parameter.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditableMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.FilterComponent
apply, getDataLoader, isAutoApply, isConditionModificationDelegated, setAutoApply, setConditionModificationDelegated, setDataLoaderMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabledMethods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValueMethods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessageMethods inherited from interface io.jmix.ui.component.SingleFilterComponent
getCaptionWidth, getCaptionWidthSizeUnit, getParameterName, getValueComponent, isCaptionVisible, setCaptionVisible, setCaptionWidth, setParameterName, setValueComponentMethods inherited from interface io.jmix.ui.component.SupportsCaptionPosition
getCaptionPosition, setCaptionPositionMethods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
getQueryCondition
JpqlCondition getQueryCondition()- Specified by:
getQueryConditionin interfaceFilterComponent- Returns:
- a
JpqlConditionrelated 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
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
joinorleft joinstatements.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
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 sectionjoin- a JPQL expression which will be added to the 'from' data loader query section- See Also:
-
setHasInExpression
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
-