Package org.mybatis.dynamic.sql
Class AbstractListValueCondition<T>
java.lang.Object
org.mybatis.dynamic.sql.AbstractListValueCondition<T>
- All Implemented Interfaces:
RenderableCondition<T>
- Direct Known Subclasses:
IsIn,IsInCaseInsensitive,IsInCaseInsensitiveWhenPresent,IsInWhenPresent,IsNotIn,IsNotInCaseInsensitive,IsNotInCaseInsensitiveWhenPresent,IsNotInWhenPresent
public abstract class AbstractListValueCondition<T>
extends Object
implements RenderableCondition<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceConditions may implement Filterable to add optionality to rendering.static interfaceConditions may implement Mappable to alter condition values or types during rendering. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <S extends AbstractListValueCondition<T>>
SfilterSupport(Predicate<? super T> predicate, Function<Collection<T>, S> constructor, S self, Supplier<S> emptySupplier) booleanisEmpty()Subclasses can override this to indicate whether the condition is considered empty.protected <R,S extends AbstractListValueCondition<R>>
SmapSupport(Function<? super T, ? extends R> mapper, Function<Collection<R>, S> constructor, Supplier<S> emptySupplier) abstract Stringoperator()renderCondition(RenderingContext renderingContext, BindableColumn<T> leftColumn) Render a condition - typically a condition in a WHERE clause.values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mybatis.dynamic.sql.RenderableCondition
renderingSkipped, renderLeftColumn, shouldRender
-
Field Details
-
values
-
-
Constructor Details
-
AbstractListValueCondition
-
-
Method Details
-
values
-
isEmpty
public boolean isEmpty()Description copied from interface:RenderableConditionSubclasses 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.- Specified by:
isEmptyin interfaceRenderableCondition<T>- Returns:
- true if the condition is empty.
-
filterSupport
protected <S extends AbstractListValueCondition<T>> S filterSupport(Predicate<? super T> predicate, Function<Collection<T>, S> constructor, S self, Supplier<S> emptySupplier) -
mapSupport
protected <R,S extends AbstractListValueCondition<R>> S mapSupport(Function<? super T, ? extends R> mapper, Function<Collection<R>, S> constructor, Supplier<S> emptySupplier) -
operator
-
renderCondition
public FragmentAndParameters renderCondition(RenderingContext renderingContext, BindableColumn<T> leftColumn) Description copied from interface:RenderableConditionRender a condition - typically a condition in a WHERE clause.A rendered condition includes an SQL fragment, and any associated parameters. For example, the
isEqualcondition should be rendered as "= ?" where "?" is a properly formatted parameter marker (the parameter marker can be computed from theRenderingContext). Note that a rendered condition should NOT include the left side of the phrase - that is rendered by theRenderableCondition.renderLeftColumn(RenderingContext, BindableColumn)method.- Specified by:
renderConditionin interfaceRenderableCondition<T>- Parameters:
renderingContext- the current rendering contextleftColumn- the column related to this condition in a where clause- Returns:
- the rendered condition. Should NOT include the column.
-