Package org.mybatis.dynamic.sql
Interface VisitableCondition<T>
- All Known Subinterfaces:
CaseInsensitiveVisitableCondition
- All Known Implementing Classes:
AbstractColumnComparisonCondition
,AbstractListValueCondition
,AbstractNoValueCondition
,AbstractSingleValueCondition
,AbstractSubselectCondition
,AbstractTwoValueCondition
,IsBetween
,IsEqualTo
,IsEqualToColumn
,IsEqualToWithSubselect
,IsGreaterThan
,IsGreaterThanColumn
,IsGreaterThanOrEqualTo
,IsGreaterThanOrEqualToColumn
,IsGreaterThanOrEqualToWithSubselect
,IsGreaterThanWithSubselect
,IsIn
,IsInCaseInsensitive
,IsInCaseInsensitiveWhenPresent
,IsInWhenPresent
,IsInWithSubselect
,IsLessThan
,IsLessThanColumn
,IsLessThanOrEqualTo
,IsLessThanOrEqualToColumn
,IsLessThanOrEqualToWithSubselect
,IsLessThanWithSubselect
,IsLike
,IsLikeCaseInsensitive
,IsNotBetween
,IsNotEqualTo
,IsNotEqualToColumn
,IsNotEqualToWithSubselect
,IsNotIn
,IsNotInCaseInsensitive
,IsNotInCaseInsensitiveWhenPresent
,IsNotInWhenPresent
,IsNotInWithSubselect
,IsNotLike
,IsNotLikeCaseInsensitive
,IsNotNull
,IsNull
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescription<R> R
accept
(ConditionVisitor<T, R> visitor) default boolean
isEmpty()
Subclasses can override this to indicate whether the condition is considered empty.default String
overrideRenderedLeftColumn
(String renderedLeftColumn) This method is called during rendering.default void
This method will be called during rendering whenshouldRender(RenderingContext)
returns false.default boolean
shouldRender
(RenderingContext renderingContext) Subclasses can override this to inform the renderer if the condition should not be included in the rendered SQL.
-
Method Details
-
accept
-
shouldRender
Subclasses can override this to inform the renderer if the condition should not be included in the rendered SQL. Typically, conditions will not render if they are empty.- Returns:
- true if the condition should render.
-
isEmpty
default boolean isEmpty()Subclasses can override this to indicate whether the condition is considered empty. This is primarily used in map and filter operations - the map and filter functions will not be applied if the condition is empty.- Returns:
- true if the condition is empty.
-
renderingSkipped
default void renderingSkipped()This method will be called during rendering whenshouldRender(RenderingContext)
returns false. -
overrideRenderedLeftColumn
This method is called during rendering. Its purpose is to allow conditions to change the value of the rendered left column. This is primarily used in the case-insensitive conditions where we surround the rendered column with "upper(" and ")".- Parameters:
renderedLeftColumn
- the rendered left column- Returns:
- the altered column - by default no change is applied
-