Package io.jmix.ui.component.impl
Class JpqlFilterImpl<V>
java.lang.Object
io.jmix.ui.component.CompositeComponent<HBoxLayout>
io.jmix.ui.component.impl.AbstractSingleFilterComponent<V>
io.jmix.ui.component.impl.JpqlFilterImpl<V>
- All Implemented Interfaces:
AttachNotifier,Component,Component.BelongToFrame,Component.Editable,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,CompositeWithCaption,CompositeWithDescription,CompositeWithHtmlCaption,CompositeWithHtmlDescription,FilterComponent,HasContextHelp,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasValue<V>,JpqlFilter<V>,Requirable,SingleFilterComponent<V>,SupportsCaptionPosition,Validatable
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.component.CompositeComponent
CompositeComponent.CreateEventNested 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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected static final Stringprotected JpqlFilterSupportprotected Classprotected Stringprotected StringFields inherited from class io.jmix.ui.component.impl.AbstractSingleFilterComponent
autoApply, caption, captionLabel, captionPosition, captionVisible, captionWidth, conditionModificationDelegated, dataLoader, icon, queryCondition, TRUNCATED_CAPTION_STYLENAME, uiComponents, valueComponentFields inherited from class io.jmix.ui.component.CompositeComponent
applicationContext, frame, id, prefixId, rootFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZEFields inherited from interface io.jmix.ui.component.JpqlFilter
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JpqlConditiongetJoin()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.booleanprotected voidinitRootComponent(HBoxLayout 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.voidsetJpqlFilterSupport(JpqlFilterSupport jpqlFilterSupport) 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.ui.component.impl.AbstractSingleFilterComponent
addValueChangeListener, apply, checkValueComponentState, createCaptionLabel, createRootComponent, focus, getCaption, getCaptionPosition, getCaptionWidth, getCaptionWidthSizeUnit, getChildAlignment, getContextHelpIconClickHandler, getContextHelpText, getDataLoader, getIcon, getIconName, getRequiredMessage, getTabIndex, getValue, getValueComponent, initValueComponent, isAutoApply, isCaptionVisible, isConditionModificationDelegated, isContextHelpTextHtmlEnabled, isEditable, isRequired, isValid, onCreate, onValueChanged, setAutoApply, setCaption, setCaptionAsHtml, setCaptionPosition, setCaptionVisible, setCaptionWidth, setConditionModificationDelegated, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDataLoader, setEditable, setIcon, setIconFromSet, setRequired, setRequiredMessage, setTabIndex, setUiComponentProperties, setUiComponents, setupLoaderFirstResult, setValue, setValueComponent, setWidth, updateCaption, updateCaptionLabelTruncation, updateCaptionLayout, updateChildAlignment, updateDataLoaderCondition, updateIcon, validateMethods inherited from class io.jmix.ui.component.CompositeComponent
addAttachListener, addCreateListener, addDetachListener, addStyleName, assignDebugId, attached, detached, disableEventListeners, enableEventListeners, getAlignment, getComposition, getCompositionOrNull, getDebugId, getEventHub, getFrame, getFullId, getHeight, getHeightSizeUnit, getId, getInnerComponent, getInnerComponentOptional, getParent, getPrefixId, getStyleName, getUiEventListeners, getWidth, getWidthSizeUnit, hasSubscriptions, isAttached, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, publish, removeStyleName, setAlignment, setApplicationContext, setComposition, setDebugId, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setId, setParent, setResponsive, setStyleName, setUiEventListeners, setVisible, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, updateComponentIds, updateIdIfNeeded, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.CompositeWithDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.CompositeWithHtmlCaption
isCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.CompositeWithHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods 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.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, getValueComponent, isCaptionVisible, setCaptionVisible, setCaptionWidth, setValueComponentMethods inherited from interface io.jmix.ui.component.SupportsCaptionPosition
getCaptionPosition, setCaptionPositionMethods inherited from interface io.jmix.ui.component.Validatable
isValid, isValidateOnCommit, validate
-
Field Details
-
JPQL_FILTER_STYLENAME
- See Also:
-
jpqlFilterSupport
-
parameterName
-
parameterClass
-
where
-
join
-
hasInExpression
protected boolean hasInExpression
-
-
Constructor Details
-
JpqlFilterImpl
public JpqlFilterImpl()
-
-
Method Details
-
setJpqlFilterSupport
-
initRootComponent
- Overrides:
initRootComponentin classAbstractSingleFilterComponent<V>
-
createQueryCondition
- Specified by:
createQueryConditionin classAbstractSingleFilterComponent<V>
-
getInnerComponentPrefix
- Specified by:
getInnerComponentPrefixin classAbstractSingleFilterComponent<V>
-
getQueryCondition
- Specified by:
getQueryConditionin interfaceFilterComponent- Specified by:
getQueryConditionin interfaceJpqlFilter<V>- Overrides:
getQueryConditionin classAbstractSingleFilterComponent<V>- Returns:
- a
Conditionrelated to the current filter component
-
updateQueryCondition
- Specified by:
updateQueryConditionin classAbstractSingleFilterComponent<V>
-
getParameterName
- Specified by:
getParameterNamein interfaceSingleFilterComponent<V>- Returns:
- the name of the associated query parameter name
-
setParameterName
Description copied from interface:SingleFilterComponentSets the name of the associated query parameter name.- Specified by:
setParameterNamein interfaceSingleFilterComponent<V>- Parameters:
parameterName- a name of the associated query parameter name
-
getParameterClass
- Specified by:
getParameterClassin interfaceJpqlFilter<V>- Returns:
- a Java class of the associated query parameter
-
setParameterClass
Description copied from interface:JpqlFilterSets a Java class of the associated query parameter.- Specified by:
setParameterClassin interfaceJpqlFilter<V>- Parameters:
parameterClass- a Java class of the associated query parameter
-
getWhere
Description copied from interface:JpqlFilterReturns 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 ?
- Specified by:
getWherein interfaceJpqlFilter<V>- Returns:
- a JPQL expression which will be added to the 'where' data loader query section
- See Also:
-
getJoin
Description copied from interface:JpqlFilterReturns 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- Specified by:
getJoinin interfaceJpqlFilter<V>- Returns:
- a JPQL expression which will be added to the 'from' data loader query section
- See Also:
-
setCondition
Description copied from interface:JpqlFilterSets JPQL expressions which will be added to the data loader query 'from' and 'where' sections.- Specified by:
setConditionin interfaceJpqlFilter<V>- 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()- Specified by:
hasInExpressionin interfaceJpqlFilter<V>- Returns:
- whether the query condition has an IN expression and the value is a collection
-
setHasInExpression
public void setHasInExpression(boolean hasInExpression) Description copied from interface:JpqlFilterSets whether the query condition has an IN expression and the value is a collection.- Specified by:
setHasInExpressionin interfaceJpqlFilter<V>- Parameters:
hasInExpression- whether the query condition has an IN expression
-
resetQueryCondition
protected void resetQueryCondition()
-