Class JpqlFilter<V>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<V>
io.jmix.flowui.component.filer.SingleFilterComponentBase<V>
io.jmix.flowui.component.jpqlfilter.JpqlFilter<V>
- Type Parameters:
V- value type
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,,V>, V> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,,V>, V> com.vaadin.flow.component.shared.HasTooltip,FilterComponent,SingleFilterComponent<V>,HasRequired,SupportsLabelPosition,SupportsValidation<V>,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
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 and a field for
editing a condition value.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>Nested classes/interfaces inherited from interface io.jmix.flowui.component.SupportsLabelPosition
SupportsLabelPosition.LabelPosition -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected static final Stringprotected JpqlFilterSupportprotected Class<?>protected Stringprotected StringFields inherited from class io.jmix.flowui.component.filer.SingleFilterComponentBase
applicationContext, autoApply, conditionModificationDelegated, dataLoader, FILTER_LABEL_CLASS_NAME, label, labelDelegate, labelPosition, labelText, labelVisible, labelWidth, queryCondition, root, uiComponents, valueComponentFields inherited from interface io.jmix.flowui.component.HasRequired
PROPERTY_REQUIREDFields inherited from interface io.jmix.flowui.component.SupportsValidation
PROPERTY_ERROR_MESSAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected JpqlConditiongetJoin()Returns a JPQL expression which will be added to the 'from' data loader query section.Class<?>getWhere()Returns a JPQL expression which will be added to the 'where' data loader query section.booleanprotected voidinitRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) protected voidvoidsetCondition(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.voidsetParameterName(String parameterName) Sets the name of the associated query parameter name.protected voidupdateQueryCondition(V newValue) Methods inherited from class io.jmix.flowui.component.filer.SingleFilterComponentBase
addValidator, afterPropertiesSet, apply, blur, checkValueComponentState, createLabel, createRootComponent, executeValidators, focus, generateModelValue, getDataLoader, getLabel, getLabelPosition, getLabelWidth, getRequiredMessage, getRoot, getValueComponent, initComponent, initValueComponent, isAutoApply, isConditionModificationDelegated, isInvalid, isLabelVisible, onFieldStatusChanged, onFieldValueChanged, onFilterValueChanged, setApplicationContext, setAutoApply, setConditionModificationDelegated, setDataLoader, setInvalid, setLabel, setLabelDelegate, setLabelInternal, setLabelPosition, setLabelVisible, setLabelWidth, setPresentationValue, setReadOnly, setRequired, setRequiredMessage, setTabIndex, setupLoaderFirstResult, setValueComponent, setWidth, updateChildAlignment, updateDataLoaderCondition, updateLabelLayoutMethods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getErrorMessage, onAttach, remove, removeThemeVariants, setErrorMessage, updateValueMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, getTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface io.jmix.flowui.component.HasRequired
isRequiredMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisibleMethods inherited from interface io.jmix.flowui.component.SupportsValidation
getErrorMessage, setErrorMessage
-
Field Details
-
JPQL_FILTER_CLASS_NAME
- See Also:
-
jpqlFilterSupport
-
parameterName
-
parameterClass
-
where
-
join
-
hasInExpression
protected boolean hasInExpression
-
-
Constructor Details
-
JpqlFilter
public JpqlFilter()
-
-
Method Details
-
autowireDependencies
protected void autowireDependencies()- Overrides:
autowireDependenciesin classSingleFilterComponentBase<V>
-
initRootComponent
protected void initRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) - Overrides:
initRootComponentin classSingleFilterComponentBase<V>
-
createQueryCondition
- Specified by:
createQueryConditionin classSingleFilterComponentBase<V>
-
getInnerComponentPrefix
- Specified by:
getInnerComponentPrefixin classSingleFilterComponentBase<V>
-
getQueryCondition
- Specified by:
getQueryConditionin interfaceFilterComponent- Overrides:
getQueryConditionin classSingleFilterComponentBase<V>- Returns:
- a
JpqlConditionrelated to the current JpqlFilter
-
updateQueryCondition
- Specified by:
updateQueryConditionin classSingleFilterComponentBase<V>
-
getParameterName
- Returns:
- the name of the associated query parameter name
-
setParameterName
Description copied from interface:SingleFilterComponentSets the name of the associated query parameter name.- Parameters:
parameterName- a name of the associated query parameter name
-
getParameterClass
- Returns:
- a Java class of the associated query parameter
-
setParameterClass
Sets a Java class of the associated query parameter.- Parameters:
parameterClass- a Java class of the associated query parameter
-
getWhere
Returns 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:
-
hasInExpression
public boolean hasInExpression()- Returns:
- whether the query condition has an IN expression and the value is a collection
-
setHasInExpression
public 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
-
resetQueryCondition
protected void resetQueryCondition()
-