Package org.mybatis.dynamic.sql
Class AbstractListValueCondition<T>
- java.lang.Object
-
- org.mybatis.dynamic.sql.AbstractListValueCondition<T>
-
- All Implemented Interfaces:
VisitableCondition<T>
- Direct Known Subclasses:
IsIn
,IsInCaseInsensitive
,IsNotIn
,IsNotInCaseInsensitive
public abstract class AbstractListValueCondition<T> extends java.lang.Object implements VisitableCondition<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
renderWhenEmpty
protected java.util.Collection<T>
values
protected java.util.function.UnaryOperator<java.util.stream.Stream<T>>
valueStreamTransformer
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractListValueCondition(java.util.Collection<T> values)
protected
AbstractListValueCondition(java.util.Collection<T> values, java.util.function.UnaryOperator<java.util.stream.Stream<T>> valueStreamTransformer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <R> R
accept(ConditionVisitor<T,R> visitor)
protected void
forceRenderingWhenEmpty()
Use with caution - this could cause the library to render invalid SQL like "where column in ()".<R> java.util.stream.Stream<R>
mapValues(java.util.function.Function<T,R> mapper)
abstract java.lang.String
renderCondition(java.lang.String columnName, java.util.stream.Stream<java.lang.String> placeholders)
boolean
shouldRender()
Subclasses can override this to inform the renderer if the condition should not be included in the rendered SQL.
-
-
-
Method Detail
-
mapValues
public final <R> java.util.stream.Stream<R> mapValues(java.util.function.Function<T,R> mapper)
-
shouldRender
public boolean shouldRender()
Description copied from interface:VisitableCondition
Subclasses can override this to inform the renderer if the condition should not be included in the rendered SQL. For example, IsEqualWhenPresent will not render if the value is null.- Specified by:
shouldRender
in interfaceVisitableCondition<T>
- Returns:
- true if the condition should render.
-
forceRenderingWhenEmpty
protected void forceRenderingWhenEmpty()
Use with caution - this could cause the library to render invalid SQL like "where column in ()".
-
accept
public <R> R accept(ConditionVisitor<T,R> visitor)
- Specified by:
accept
in interfaceVisitableCondition<T>
-
renderCondition
public abstract java.lang.String renderCondition(java.lang.String columnName, java.util.stream.Stream<java.lang.String> placeholders)
-
-