Skip to content

Commit 30fc7ef

Browse files
committed
Make filtering optional on no value conditions
1 parent 7b426ce commit 30fc7ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/mybatis/dynamic/sql/AbstractNoValueCondition.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ public FragmentAndParameters renderCondition(RenderingContext renderingContext,
3939
return FragmentAndParameters.fromFragment(operator());
4040
}
4141

42+
/**
43+
* Conditions may implement Filterable to add optionality to rendering.
44+
*
45+
* <p>If a condition is Filterable, then a user may add a filter to the usage of the condition that makes a decision
46+
* whether to render the condition at runtime. Conditions that fail the filter will be dropped from the
47+
* rendered SQL.
48+
*
49+
* <p>Implementations of Filterable may call
50+
* {@link AbstractNoValueCondition#filterSupport(BooleanSupplier, Supplier, AbstractNoValueCondition)} as
51+
* a common implementation of the filtering algorithm.
52+
*/
4253
public interface Filterable {
4354
/**
4455
* If renderable and the supplier returns true, returns this condition. Else returns a condition that will not

0 commit comments

Comments
 (0)