public class JpqlFilterImpl<V> extends AbstractSingleFilterComponent<V> implements JpqlFilter<V>
CompositeComponent.CreateEvent
HasValue.ValueChangeEvent<V>
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
SupportsCaptionPosition.CaptionPosition
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasInExpression |
protected java.lang.String |
join |
protected static java.lang.String |
JPQL_FILTER_STYLENAME |
protected JpqlFilterSupport |
jpqlFilterSupport |
protected java.lang.Class |
parameterClass |
protected java.lang.String |
parameterName |
protected java.lang.String |
where |
autoApply, caption, captionLabel, captionPosition, captionWidth, conditionModificationDelegated, dataLoader, icon, queryCondition, uiComponents, valueComponent
applicationContext, frame, id, root
NAME
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
JpqlFilterImpl() |
Modifier and Type | Method and Description |
---|---|
protected io.jmix.core.querycondition.JpqlCondition |
createQueryCondition() |
java.lang.String |
getInnerComponentPrefix() |
java.lang.String |
getJoin()
Returns a JPQL expression which will be added to the 'from' data loader query section.
|
java.lang.Class |
getParameterClass() |
java.lang.String |
getParameterName() |
io.jmix.core.querycondition.JpqlCondition |
getQueryCondition() |
java.lang.String |
getWhere()
Returns a a JPQL expression which will be added to the 'where' data loader query section.
|
boolean |
hasInExpression() |
protected void |
initRootComponent(HBoxLayout root) |
protected void |
resetQueryCondition() |
void |
setCondition(java.lang.String where,
java.lang.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(java.lang.Class parameterClass)
Sets a Java class of the associated query parameter.
|
void |
setParameterName(java.lang.String parameterName)
Sets the name of the associated query parameter name.
|
protected void |
updateQueryCondition(V newValue) |
addValueChangeListener, apply, checkValueComponentState, createCaptionLabel, createRootComponent, focus, getCaption, getCaptionPosition, getCaptionWidth, getCaptionWidthSizeUnit, getChildAlignment, getContextHelpIconClickHandler, getContextHelpText, getDataLoader, getIcon, getIconName, getRequiredMessage, getTabIndex, getValue, getValueComponent, initValueComponent, isAutoApply, isConditionModificationDelegated, isContextHelpTextHtmlEnabled, isEditable, isRequired, isValid, onCreate, onValueChanged, setAutoApply, setCaption, setCaptionAsHtml, setCaptionPosition, setCaptionWidth, setConditionModificationDelegated, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDataLoader, setEditable, setIcon, setIconFromSet, setRequired, setRequiredMessage, setTabIndex, setUiComponentProperties, setUiComponents, setValue, setValueComponent, setWidth, updateCaption, updateCaptionLayout, updateChildAlignment, updateDataLoaderCondition, updateIcon, validate
addAttachListener, addCreateListener, addDetachListener, addStyleName, assignDebugId, attached, detached, disableEventListeners, enableEventListeners, getAlignment, getComposition, getCompositionOrNull, getDebugId, getEventHub, getFrame, getHeight, getHeightSizeUnit, getId, getInnerComponent, getInnerComponentOptional, getParent, 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, withUnwrapped, withUnwrappedComposition
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCaptionWidth, getCaptionWidthSizeUnit, getValueComponent, setCaptionWidth, setValueComponent
apply, getDataLoader, isAutoApply, isConditionModificationDelegated, setAutoApply, setConditionModificationDelegated, setDataLoader
getFrame, setFrame
addValueChangeListener, clear, getEmptyValue, getValue, isEmpty, setValue
getIcon, setIcon, setIconFromSet
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
isEditable, isEditableWithParent, setEditable
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
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
getCaptionPosition, setCaptionPosition
getRequiredMessage, isRequired, setRequired, setRequiredMessage
isValid, isValidateOnCommit, validate
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
isCaptionAsHtml
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
protected static final java.lang.String JPQL_FILTER_STYLENAME
protected JpqlFilterSupport jpqlFilterSupport
protected java.lang.String parameterName
protected java.lang.Class parameterClass
protected java.lang.String where
protected java.lang.String join
protected boolean hasInExpression
@Autowired public void setJpqlFilterSupport(JpqlFilterSupport jpqlFilterSupport)
protected void initRootComponent(HBoxLayout root)
initRootComponent
in class AbstractSingleFilterComponent<V>
protected io.jmix.core.querycondition.JpqlCondition createQueryCondition()
createQueryCondition
in class AbstractSingleFilterComponent<V>
public java.lang.String getInnerComponentPrefix()
getInnerComponentPrefix
in class AbstractSingleFilterComponent<V>
public io.jmix.core.querycondition.JpqlCondition getQueryCondition()
getQueryCondition
in interface FilterComponent
getQueryCondition
in interface JpqlFilter<V>
getQueryCondition
in class AbstractSingleFilterComponent<V>
Condition
related to the current filter componentprotected void updateQueryCondition(@Nullable V newValue)
updateQueryCondition
in class AbstractSingleFilterComponent<V>
public java.lang.String getParameterName()
getParameterName
in interface SingleFilterComponent<V>
public void setParameterName(java.lang.String parameterName)
SingleFilterComponent
setParameterName
in interface SingleFilterComponent<V>
parameterName
- a name of the associated query parameter namepublic java.lang.Class getParameterClass()
getParameterClass
in interface JpqlFilter<V>
public void setParameterClass(java.lang.Class parameterClass)
JpqlFilter
setParameterClass
in interface JpqlFilter<V>
parameterClass
- a Java class of the associated query parameterpublic java.lang.String getWhere()
JpqlFilter
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 ?
getWhere
in interface JpqlFilter<V>
JpqlFilter.setCondition(String, String)
@Nullable public java.lang.String getJoin()
JpqlFilter
This can be required to create a complex condition based on an attribute of a related
collection. The expression should be started with join
or
left 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
getJoin
in interface JpqlFilter<V>
JpqlFilter.setCondition(String, String)
public void setCondition(java.lang.String where, @Nullable java.lang.String join)
JpqlFilter
setCondition
in interface JpqlFilter<V>
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 sectionJpqlFilter.getJoin()
,
JpqlFilter.getWhere()
public boolean hasInExpression()
hasInExpression
in interface JpqlFilter<V>
public void setHasInExpression(boolean hasInExpression)
JpqlFilter
setHasInExpression
in interface JpqlFilter<V>
hasInExpression
- whether the query condition has an IN expressionprotected void resetQueryCondition()