24
24
25
25
import org .jetbrains .annotations .NotNull ;
26
26
import org .mybatis .dynamic .sql .common .OrderByModel ;
27
+ import org .mybatis .dynamic .sql .configuration .StatementConfiguration ;
27
28
import org .mybatis .dynamic .sql .render .RenderingContext ;
28
29
import org .mybatis .dynamic .sql .render .RenderingStrategy ;
29
30
import org .mybatis .dynamic .sql .select .render .SelectRenderer ;
@@ -34,12 +35,14 @@ public class SelectModel {
34
35
private final List <QueryExpressionModel > queryExpressions ;
35
36
private final OrderByModel orderByModel ;
36
37
private final PagingModel pagingModel ;
38
+ private final StatementConfiguration statementConfiguration ;
37
39
38
40
private SelectModel (Builder builder ) {
39
41
queryExpressions = Objects .requireNonNull (builder .queryExpressions );
40
42
Validator .assertNotEmpty (queryExpressions , "ERROR.14" ); //$NON-NLS-1$
41
43
orderByModel = builder .orderByModel ;
42
44
pagingModel = builder .pagingModel ;
45
+ statementConfiguration = Objects .requireNonNull (builder .statementConfiguration );
43
46
}
44
47
45
48
public <R > Stream <R > mapQueryExpressions (Function <QueryExpressionModel , R > mapper ) {
@@ -82,6 +85,7 @@ public static class Builder {
82
85
private final List <QueryExpressionModel > queryExpressions = new ArrayList <>();
83
86
private OrderByModel orderByModel ;
84
87
private PagingModel pagingModel ;
88
+ private StatementConfiguration statementConfiguration ;
85
89
86
90
public Builder withQueryExpression (QueryExpressionModel queryExpression ) {
87
91
this .queryExpressions .add (queryExpression );
@@ -103,6 +107,11 @@ public Builder withPagingModel(PagingModel pagingModel) {
103
107
return this ;
104
108
}
105
109
110
+ public Builder withStatementConfiguration (StatementConfiguration statementConfiguration ) {
111
+ this .statementConfiguration = statementConfiguration ;
112
+ return this ;
113
+ }
114
+
106
115
public SelectModel build () {
107
116
return new SelectModel (this );
108
117
}
0 commit comments