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.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
Fields 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.boolean
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
setParameterClass
(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, 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.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
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.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
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, getParameterName, getValueComponent, isCaptionVisible, setCaptionVisible, setCaptionWidth, setParameterName, 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
-
NAME
- See Also:
-
-
Method Details
-
getQueryCondition
JpqlCondition getQueryCondition()- Specified by:
getQueryCondition
in interfaceFilterComponent
- 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
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
- 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
-