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.CreateEvent
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.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested 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
Modifier and TypeFieldDescriptionprotected boolean
protected String
protected static final String
protected JpqlFilterSupport
protected Class
protected String
protected String
Fields inherited from class io.jmix.ui.component.impl.AbstractSingleFilterComponent
autoApply, caption, captionLabel, captionPosition, captionVisible, captionWidth, conditionModificationDelegated, dataLoader, icon, queryCondition, uiComponents, valueComponent
Fields inherited from class io.jmix.ui.component.CompositeComponent
applicationContext, frame, id, prefixId, root
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields inherited from interface io.jmix.ui.component.JpqlFilter
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected JpqlCondition
getJoin()
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.boolean
protected void
initRootComponent
(HBoxLayout root) protected void
void
setCondition
(String where, String join) Sets JPQL expressions which will be added to the data loader query 'from' and 'where' sections.void
setHasInExpression
(boolean hasInExpression) Sets whether the query condition has an IN expression and the value is a collection.void
setJpqlFilterSupport
(JpqlFilterSupport jpqlFilterSupport) void
setParameterClass
(Class parameterClass) Sets a Java class of the associated query parameter.void
setParameterName
(String parameterName) Sets the name of the associated query parameter name.protected void
updateQueryCondition
(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, updateCaptionLayout, updateChildAlignment, updateDataLoaderCondition, updateIcon, validate
Methods 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, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Editable
isEditable, isEditableWithParent, setEditable
Methods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.CompositeWithDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.CompositeWithHtmlCaption
isCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.CompositeWithHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.FilterComponent
apply, getDataLoader, isAutoApply, isConditionModificationDelegated, setAutoApply, setConditionModificationDelegated, setDataLoader
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
Methods inherited from interface io.jmix.ui.component.HasValue
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
Methods inherited from interface io.jmix.ui.component.Requirable
getRequiredMessage, isRequired, setRequired, setRequiredMessage
Methods inherited from interface io.jmix.ui.component.SingleFilterComponent
getCaptionWidth, getCaptionWidthSizeUnit, getValueComponent, isCaptionVisible, setCaptionVisible, setCaptionWidth, setValueComponent
Methods inherited from interface io.jmix.ui.component.SupportsCaptionPosition
getCaptionPosition, setCaptionPosition
Methods 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:
initRootComponent
in classAbstractSingleFilterComponent<V>
-
createQueryCondition
- Specified by:
createQueryCondition
in classAbstractSingleFilterComponent<V>
-
getInnerComponentPrefix
- Specified by:
getInnerComponentPrefix
in classAbstractSingleFilterComponent<V>
-
getQueryCondition
- Specified by:
getQueryCondition
in interfaceFilterComponent
- Specified by:
getQueryCondition
in interfaceJpqlFilter<V>
- Overrides:
getQueryCondition
in classAbstractSingleFilterComponent<V>
- Returns:
- a
Condition
related to the current filter component
-
updateQueryCondition
- Specified by:
updateQueryCondition
in classAbstractSingleFilterComponent<V>
-
getParameterName
- Specified by:
getParameterName
in interfaceSingleFilterComponent<V>
- Returns:
- the name of the associated query parameter name
-
setParameterName
Description copied from interface:SingleFilterComponent
Sets the name of the associated query parameter name.- Specified by:
setParameterName
in interfaceSingleFilterComponent<V>
- Parameters:
parameterName
- a name of the associated query parameter name
-
getParameterClass
- Specified by:
getParameterClass
in interfaceJpqlFilter<V>
- Returns:
- a Java class of the associated query parameter
-
setParameterClass
Description copied from interface:JpqlFilter
Sets a Java class of the associated query parameter.- Specified by:
setParameterClass
in interfaceJpqlFilter<V>
- Parameters:
parameterClass
- a Java class of the associated query parameter
-
getWhere
Description copied from interface:JpqlFilter
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 ?
- Specified by:
getWhere
in interfaceJpqlFilter<V>
- Returns:
- a JPQL expression which will be added to the 'where' data loader query section
- See Also:
-
getJoin
Description copied from interface:JpqlFilter
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
orleft 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
- Specified by:
getJoin
in interfaceJpqlFilter<V>
- Returns:
- a JPQL expression which will be added to the 'from' data loader query section
- See Also:
-
setCondition
Description copied from interface:JpqlFilter
Sets JPQL expressions which will be added to the data loader query 'from' and 'where' sections.- Specified by:
setCondition
in 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:
hasInExpression
in 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:JpqlFilter
Sets whether the query condition has an IN expression and the value is a collection.- Specified by:
setHasInExpression
in interfaceJpqlFilter<V>
- Parameters:
hasInExpression
- whether the query condition has an IN expression
-
resetQueryCondition
protected void resetQueryCondition()
-